yolop Posted December 19, 2010 Share Posted December 19, 2010 i wrote this code <?php $mail_to='[email protected]'; $subject_mail='UYYYY'; $message='XXXXX'; $headers = "MIME-Version: 1.0 \r\n"; $headers .= "Content-type: text/html; charset=UTF-8 \r\n"; $headers .= "From: [email protected] \r\n"; mail($mail_to, $subject_mail, $message, $headers ); ?> but the email will not send why please? Quote Link to comment https://forums.phpfreaks.com/topic/222133-email-was-not-send/ Share on other sites More sharing options...
menator Posted December 19, 2010 Share Posted December 19, 2010 Are you using a local server. Some ISP's block port 25 to help prevent spam Quote Link to comment https://forums.phpfreaks.com/topic/222133-email-was-not-send/#findComment-1149250 Share on other sites More sharing options...
BlueSkyIS Posted December 19, 2010 Share Posted December 19, 2010 how do you know the email is not sent? gmail is notorious for blocking incoming emails without proper headers. i suggest that you use a different email address for testing. Quote Link to comment https://forums.phpfreaks.com/topic/222133-email-was-not-send/#findComment-1149251 Share on other sites More sharing options...
PFMaBiSmAd Posted December 19, 2010 Share Posted December 19, 2010 Your To: address is a gmail address and you are putting a gmail address into the From: address header. If you are not sending this using a gmail mail server, I can guarantee that gmail will discard the email. The From: address must be an address hosted at the sending mail server where your php script is running at. Quote Link to comment https://forums.phpfreaks.com/topic/222133-email-was-not-send/#findComment-1149254 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.