Jump to content

mail() function with xampp


ninedoors

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.