Jump to content

Mail() function


AaronMe

Recommended Posts

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);
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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, 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.