947740 Posted June 19, 2009 Share Posted June 19, 2009 The email sends when the $to account is hosted by my web server, but not if I change the $to account to hotmail or something else. Is there an easy fix for this? <?php ini_set(SMTP,"***") or die("failed to set SMTP"); ini_set(smtp_port,"25") or die("failed to set smtp_port"); $to = ***; $subject = 'test'; $message = 'hello'; $headers = 'From: ***' . "\r\n" . 'Reply-To: ***' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/162926-solved-mail/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 19, 2009 Share Posted June 19, 2009 What about the From: address? Is that hosted on your sending mail server? Link to comment https://forums.phpfreaks.com/topic/162926-solved-mail/#findComment-859640 Share on other sites More sharing options...
947740 Posted June 19, 2009 Author Share Posted June 19, 2009 It was. It turns out it was a mail server problem...mail relay was not turned on. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/162926-solved-mail/#findComment-859642 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.