2
Contributors
8
Replies
33
Views
4 Years
Discussion Span
Last Post by dinhunzvi
0

Install a mail server (Mercury for example). Windows does not have a built-in one. Another option is to use a tool like PHPMailer and connect to your GMail account (assuming you have one).

0

do i need to make any changes to the php.ini file after installing the mail server

0

have installed Mercury Mail Server and i'm getting a warning:

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moonlight\test.php on line 9.
what changes to i need to make, my php code is as follows:

<?php
    ini_set('SMTP','localhost'); 
    ini_set('sendmail_from', 'dougiedj@gmail.com'); 

    $to = 'dinhunzvi@live.com';
    $subject = 'Example subject';
    $body = 'With an example body…'; 

    mail($to, $subject , $body);
?>
0

changed the sendmail_from variable to dnhunzvi@moonlight.co.zw but i'm now getting this error.

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moonlight\test.php on line 9

0

Failed to connect to mailserver at "localhost" port 25

This suggests Mercury is not running.

BTW, I meant to say "without line 3" in my previous post.

Edited by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.