I'm writing a newsletter module in PHP/MySQL.
How can I send email to site subscribers that doesn't cause my mail server get blocked? I mean it doesn't treat as a spam sender and how I can implement this ?
Thanks in Advance.
I'm writing a newsletter module in PHP/MySQL.
How can I send email to site subscribers that doesn't cause my mail server get blocked? I mean it doesn't treat as a spam sender and how I can implement this ?
Thanks in Advance.
Your question does not tell us your setup too.
Add headers to avoid this --
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
Also look at this link for further as there is no sure shot
for this -- Link 2
Instead of just reiterating everything that is said around the internet, i had might as well point you to some good articles to broaden your knowledge on how spam filters work:
How They Think:
Common Algorithm (how they learn from likes of spam assassin, akismet, etc):
Trigger Words to Avoid:
Asside from that, ensure you have correctly formed headers which can be achieved by using SwiftMail
Another very good way of of helping to ensure your messages get delivered and not marked as spam is to use plain text (not HTML). Though if HTML is a must, just ensure you also use a plain text version as well as HTML.
Depending on your circumstances you could pass this all off to a 3rd party mailing service such as mailchimp.com and they will help to ensure your emails get delivered (by correctly forming the headers, dealing with the legal requirements to fullfill the CAN-SPAM act etc).
Oh and a little tip, don't put the word "unsubscribe" in your email at all, use something like "i don't want these emails anymore" as it won't trigger such powerfull spam trigger words if any at all.