Sending mail in php

前端 未结 5 652
死守一世寂寞
死守一世寂寞 2020-12-21 05:45

Here i am new to PHP, i want to send the mail and my application is running on go daddy sahre hosting so please tell me hows can i achieve it . thanks to all.

I got

相关标签:
5条回答
  • 2020-12-21 06:17

    See a good example for sending emails here

    http://thinkspacetechnologies.com/blog/sending-mails-via-php-script-2/

    0 讨论(0)
  • 2020-12-21 06:17

    Beware that while the PHP mail() function is pretty simple and convenient to use, the computer OS must be able to send mail by itself.

    You have to check the return value of mail() (boolean, true if mail was accepted for delivery).

      $result = mail( ... );
    

    If the $result variable is false, you have to check your computer mail configuration/implementation.

    If it is true, and the mail is not sent, you have to check the computer mail logs.

    0 讨论(0)
  • 2020-12-21 06:27

    Naveed's answer is all that is required for sending a basic email.

    For reference:

    PHP's Mail function - http://php.net/manual/en/function.mail.php

    Commonly used classes providing additional functionality:

    PHPMailer - http://phpmailer.worxware.com/

    Zend_Mail - http://framework.zend.com/manual/en/zend.mail.html

    0 讨论(0)
  • 2020-12-21 06:32

    The PHP mail() Function

    Basic Example:

    <?php
    $to = "someone@example.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
    
    0 讨论(0)
  • 2020-12-21 06:34
    <?php
    $message="hi";
    $to="to@exmaple.com";
    $sub='Subject of the Mail';
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    $headers .= "From:from@example.com\r\n";
    mail($to,$sub,$message,$headers); 
    ?>
    

    simple Mail sending in php

    this will accept the html tags and perform accordingly

    0 讨论(0)
提交回复
热议问题