Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Good old mail() function!

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Ok, this is REALLY getting on my nerves! For some reason the below code will only send emails to certain email addresses. If I send it to a hotmail one, it arrives fine. If, however I send it to a forwarded one (i.e. webmaster@ace-installer.com), then it doesn't come through. I've aded $php_errormsg in there to see if any errors are reported...but nothing so far...anyone got any ideas?

$subject = "New advertiser signed up...";

//send the email...
mail("$webmaster_email", $subject, $saved,
"From: $webmaster_email\r\n"
."Reply-To: $webmaster_email\r\n");

if ($phperror_msg) { normal_error("Error: $phperror_msg"); }



Thanks

Andy
 
What do you mean by "a forwarded one"? Is the hotmail address you used forwarding to that address?

In any regard, with the assumption that mail() is working (you did successfully send email), have you made sure that the machine on which PHP is running can send mail to that account?

When I run into problems like yours, I go through all the steps the mail server would to try to send a mail message:
1. Retrieve the MX record for the domain.
2. Resolve the MX machine name to an IP address.
3. Use telnet to port 25 on the machine in question to insert the mail message into the server.

Mail will return a FALSE only if the local mail server does not accept the message for delivery. It does not guarantee that the message is deliverable. Typically, the server accepts all outgoing mail, then generates a return email stating one was undeliverable if necessary. Mail has no functionality for waiting for that return email.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top