Sid9678 Posted March 25, 2009 Share Posted March 25, 2009 I Installed PHP version 5.2.3 on my Windows Server 2003 machine. PHP is working, my server is serving php pages. I cannot get my php mail page to work. It does not send e-mail. I do have SMTP installed on my server and I can send e-mail but the php page is not sending the e-mail. I'm getting the following error message: Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\Inetpub\phpmail.images4kids.com\mailtest.php on line 43 Can someone please help me get this resolved? Quote Link to comment https://forums.phpfreaks.com/topic/151061-php-mail-on-windows-server-2003/ Share on other sites More sharing options...
mr_chuya Posted April 3, 2009 Share Posted April 3, 2009 Hello ... i'm just new in php. here's what i find at http://id2.php.net/manual/en/book.mail.php. thx to these guy. ====================================== To test PHP's mail function, utilized the below : <?php $Name = "Da Duder"; //senders name $email = "email@adress.com"; //senders e-mail adress $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command ?> If did not work ... try this. <?php $Name = "Da Duder"; //senders name $email = "email@adress.com"; //senders e-mail adress $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields ini_set('sendmail_from', 'me@domain.com'); //Suggested by "Some Guy" mail($recipient, $subject, $mail_body, $header); //mail command ?> Quote Link to comment https://forums.phpfreaks.com/topic/151061-php-mail-on-windows-server-2003/#findComment-800166 Share on other sites More sharing options...
dgoosens Posted April 3, 2009 Share Posted April 3, 2009 I don't know if you did but... you should configure your smtp account in the php.ini file... also, make sure the sender's e-mail address belongs to the correct domain... this might cause problems as well... Quote Link to comment https://forums.phpfreaks.com/topic/151061-php-mail-on-windows-server-2003/#findComment-800180 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.