Jump to content

[SOLVED] mail() function warning message


ballhogjoni

Recommended Posts

I am running a windows sever and I am getting the following message:

Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in D:\Inetpub\wwwroot\xxxxxxxx\DailyReminder\dailyreminder.php on line 10

 

I know there is nothing wrong with my code, becasue I can run it on my apache server just fine with no problems. Does anyone know how to fix this on a windows server?

 

Just in case, heres my code:

<?php
$email = $_REQUEST['email'];
$date = date("Y-m-d");
$name = $_REQUEST['name'];
if (empty($_REQUEST['email']) || empty($_REQUEST['name'])) {
	echo "<html><head><title>Error</title></head><body>YOU ARE TRYING TO ACCESS THIS PAGE INCORRECTLY<br>Or, you have not filled out the previous page correctly - please go back.</body></html>";
} else {
$admin_email = 'sales@xxxxxxxxxxxxxxxx;
$header = "MIME-Version: 1.0\r\nContent-Type: text/plain; charset=\"UTF-8\"\r\nFrom: xxxxxxxxxxxxx <$admin_email>";
mail($admin_email, "New Subcriber from Daily Reminder Download", "Here are the details:\n\nDate: $date\nEmail: $email\nName: $name", $header);
?>

Link to comment
https://forums.phpfreaks.com/topic/101722-solved-mail-function-warning-message/
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.