ninedoors Posted April 7, 2008 Share Posted April 7, 2008 I have searched around and haven't been able to find an answer for my problem. I have xampp, php, mercury mail installed and I am trying to mail myself an error code but it isn't working. This is the error that I keep receiving. Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for n*****@gmail.com in C:\xampp\htdocs\PTL\gethistory1.php on line 123 I have configured the php.ini file to this: [mail function] ; For Win32 only. SMTP = 127.0.0.1 smtp_port = 25 ; For Win32 only. sendmail_from = *****@localhost.com (which is the user name I created for myself in mercury mail) Is there something I am doing wrong in the setup. Here is the code I am using with the mail() function. <?php $to = "n****@gmail.com"; $subject = "Error getting " . $brand . " history"; $message = "<b>The dates, skus and quantity had different counts for " . $twodaysago . ".</b>"; $message = "<br>The sku count was " . $counts . ", the date count was " . $countd . ", and the quantity count was ". $countq . "<br>"; $header = "From:[email protected] \r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-type: text/html\r\n"; $retval = mail ($to,$subject,$message,$header); ?> Can anyone tell me what I am doing wrong? I am going to be using this code from the xampp server and will never be uploading it to an actual webserver. Thanks Nick Link to comment https://forums.phpfreaks.com/topic/99968-mail-function-with-xampp/ Share on other sites More sharing options...
trq Posted April 7, 2008 Share Posted April 7, 2008 You need a fqdn (fully quailified domain name) to send mail from a local server. Link to comment https://forums.phpfreaks.com/topic/99968-mail-function-with-xampp/#findComment-511188 Share on other sites More sharing options...
ninedoors Posted April 7, 2008 Author Share Posted April 7, 2008 So you are telling me that I can't send mail to addresses that are not on the local server with what I have installed? Link to comment https://forums.phpfreaks.com/topic/99968-mail-function-with-xampp/#findComment-511190 Share on other sites More sharing options...
trq Posted April 7, 2008 Share Posted April 7, 2008 That is correct. You need a fqdn to send mail to an address on the wan. Link to comment https://forums.phpfreaks.com/topic/99968-mail-function-with-xampp/#findComment-511191 Share on other sites More sharing options...
ninedoors Posted April 7, 2008 Author Share Posted April 7, 2008 Thanks Thorpe, I will come up with another solution. Link to comment https://forums.phpfreaks.com/topic/99968-mail-function-with-xampp/#findComment-511193 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.