AaronMe Posted November 2, 2017 Share Posted November 2, 2017 Hi I wrote this code, i excepted to get 2 emails, but i am getting only one. what can be the reason? $msg = "Click the link:"; $msg .=$actual_link; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= "From: support1@perfactionTest.com\r\n"; $headers .= "Reply-To: myplace2@example.com\r\n"; $headers .= "Return-Path: myplace@example.com\r\n"; $headers .= "CC: sombodyelse@example.com\r\n"; $headers .= "BCC: sombodyelse@example.com\r\n"; $sub = "Confirmation Mail"; mail($email,$sub,$msg,$headers); mail($email,$sub,$msg,$headers); Quote Link to comment Share on other sites More sharing options...
ginerjm Posted November 2, 2017 Share Posted November 2, 2017 With such a short sample of your code it's hard to say WHAT could be wrong with it. Try turning on php error checking (unless it is on already and you haven't shown us). Quote Link to comment Share on other sites More sharing options...
phpmillion Posted November 2, 2017 Share Posted November 2, 2017 May I ask if there's a specific reason to use custom mail function? It has been discussed many times, and it would be much easier for you to use an "external" mailing library, such as swiftmail, phpmailer, or similar. It will do everything you need, and will add an extra security as a bonus. Quote Link to comment Share on other sites More sharing options...
gizmola Posted November 3, 2017 Share Posted November 3, 2017 How is your php mail, and mail server configured? There are a lot of possible moving parts, and ways to debug, for example, delivery to an MTA that is then sending the mails along. I can say that in the modern world, trying to send emails directly from an application server is a great way to have your email marked as spam or rejected entirely. Many ISP's put limits on these emails or block them directly. This is why there are so many remailer services. I agree with phpmillion as well. There are really sophisticated and well tested libraries like the ones he listed. You should look into using one of those. Quote Link to comment Share on other sites More sharing options...
AaronMe Posted November 6, 2017 Author Share Posted November 6, 2017 May I ask if there's a specific reason to use custom mail function? It has been discussed many times, and it would be much easier for you to use an "external" mailing library, such as swiftmail, phpmailer, or similar. It will do everything you need, and will add an extra security as a bonus. Thanks, My application send confirmation mail when someone register, I want to get notification when someone get his email BUT not as CC, i want different mail stating : " SOMEONE from PLACE register to the website.. the first mail on my code is being send and receive, Quote Link to comment Share on other sites More sharing options...
phpmillion Posted November 6, 2017 Share Posted November 6, 2017 You can do that much, much easier using any of scripts I wrote about. Give it a try Quote Link to comment 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.