why does sending emails with php code end up in spam

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
siko
Forum Commoner
Posts: 37
Joined: Tue Feb 16, 2010 11:28 pm

why does sending emails with php code end up in spam

Post by siko »

This is what I am doing to send an activation email to user after they create an account. However, most of these end up in the spam mail folder. What can I do?

Code: Select all

 
$to      = $_POST[email];
 
$subject = "MyWebsite Account Activation";
 
$message = "Welcome to MyWebsite.com!\r\rYou, or someone using your email address, has completed registration at MyWebsite.com. You can complete registration by clicking the following link: ... //link here";
                   
$headers = 'From: admin@mywebsite.com' . "\r\n" .
 
                'Reply-To: admin@mywebsite.com' . "\r\n" .
 
                'X-Mailer: PHP/' . phpversion();
 
mail($to, $subject, $message, $headers);
 
Post Reply