PHP send mail [Answered]RSS

2 replies

Last post Feb 20, 2010 09:38 AM by mmosias

  • PHP send mail

    Feb 19, 2010 08:35 PM|mmosias|LINK

    I installed PHP 5.2.12 for IIS 7 with the Microsoft Web Platform Installer. The PHP test show the installation OK. When I test sending mail with PHP no mail is sent. Should mail be configured specifically for this functionality to be available. 

    This is the send_mail.php PHP script.

     <?php

    $to = "mmowebin@gmail.com";
    $subject = "IIS sent mail";
    $message = "Sending mail through IIS server with PHP.";
    $from = "webinq1@gmail.com";
    $headers = "From: $from";
    //$sentmail_ret = @mail($to, $subject, $message, $headers);
    mail($to, $subject, $message, $headers);

    //echo $sentmail_ret . ": " . "Mail Sent.";
    echo "Mail Sent.";

    ?>

     Thanks.

    PHP mail

  • Re: PHP send mail

    Feb 19, 2010 08:41 PM|don.raman|LINK

    Hi,

    Yes, you will need to configure IIS SMTP to send mail successfully. A detailed guide available at http://www.ruhanirabin.com/php-sendmail-setup-with-smtp-iis-and-windows-servers/.

    Thanks,

    Don.

  • Re: PHP send mail

    Feb 20, 2010 09:38 AM|mmosias|LINK

    Thanks.