ashiland Posted July 31, 2011 Share Posted July 31, 2011 Hi I have set up a license selling website, it works with paypal IPN, everything works well except the mail function, where could be the problem please? here is the code in brief: <?php $payer_email = $_POST['payer_email']; $mail_To = $payer_email; $mail_Subject = "Your license"; $mail_Body = $content; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To: '.$first_name.' <'.$payer_email.'>' . "\r\n"; $headers .= 'From: mysite <[email protected]>' ."\r\n"; mail($mail_To, $mail_Subject, $mail_Body, $headers); ?> Many thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/ Share on other sites More sharing options...
Pikachu2000 Posted July 31, 2011 Share Posted July 31, 2011 Have you echoed the values you're passing to mail() to make sure they're what you'd expect them to be? Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249688 Share on other sites More sharing options...
ashiland Posted July 31, 2011 Author Share Posted July 31, 2011 yes, actually before getting to these lines all the $_post data are stored in the database and everything works well, sending email is the last step. Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249691 Share on other sites More sharing options...
voip03 Posted July 31, 2011 Share Posted July 31, 2011 your code is working in my site. try $payer_email = your email address Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249721 Share on other sites More sharing options...
ashiland Posted July 31, 2011 Author Share Posted July 31, 2011 yes, it works when I have this : $payer_email = '[email protected]'; but I need to send email to buyer ==> $payer_email = $_POST['payer_email']; Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249727 Share on other sites More sharing options...
pranshu82202 Posted July 31, 2011 Share Posted July 31, 2011 http://www.phpfreaks.com/forums/index.php?topic=340073.0 Me too unable to send mails :( Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249740 Share on other sites More sharing options...
voip03 Posted July 31, 2011 Share Posted July 31, 2011 Open the “php.ini“ Search for the attribute called “SMTP” in the php.ini file. “SMTP=localhost“. change the localhost to the smtp server name of your ISP “smtp_port” which should be set to 25. Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249743 Share on other sites More sharing options...
pranshu82202 Posted July 31, 2011 Share Posted July 31, 2011 Where the hell php.ini is located. :confused: :confused: :confused: :o :o :confused: :confused: :shrug: :shrug: > > Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249745 Share on other sites More sharing options...
voip03 Posted July 31, 2011 Share Posted July 31, 2011 Your working with php, then you should know what os php.info. google it. <? phoinfo(); ?> look at configration File path ( line 6 ) Quote Link to comment https://forums.phpfreaks.com/topic/243350-why-this-code-doesnt-send-mails/#findComment-1249753 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.