Best practices for sending emails and avoiding spam

Asked

Viewed 3,841 times

19

Nowadays, almost every web site or web system almost inevitably needs functionalities with sending emails, whether in contact forms, password recovery, account activation, order confirmation, etc.

What are the best practices to prevent these emails from being punctuated as spam?

  • Which correct email header formatting $headers .= "Content-type:text/html... ?
  • You can use CSS to style?
  • The use of image is allowed, which is the best way to use?
  • There is a limit of recipients?
  • Better use the function mail(), or a class as Phpmailer for sending authenticated email?

In summary, what are the main rules anti-spam to prevent emails from being punctuated as spam?

  • http://www.antispam.br/boaspraticas/

  • 1

    @I don’t think that’s exactly what he wants to know.

  • @Guilhermeoderdenge actually this answers only some of the various questions, but thank you anyway.

  • 3

    @Jorgeb. He wants best practices and there’s a lot of them. Also, I posted the link as a comment because I won’t have time to give a consistent response, and to add content to the topic, I left the link so that it had something else to base.

2 answers

20


Email content is just an ingredient among "best practices for sending emails".

There are many other factors that influence the classification as spam or not.

Reputation of the IP address

First of all, the IP address itself. For example: if your IP is in a low reputation range, this alone can be a reason for email rejection, regardless of everything else. I’ve had this experience: I hired a cheap VPS provider, and found out that any email sent from their servers is automatically rejected by Yahoo! Mail. In short: the reputation of the IP address is an important factor. Serious, professional and modern providers with a strong anti-spam policy will have a good reputation and this does not become a problem.

DNS records

Another important technical factor is related to dns records. Ideally, the IP address being used for submissions should be firmly associated with the domain of the sender address, including Reverse DNS properly configured. Also, records SPF and Sender ID, as well as signatures DKIM and Domainkeys In all emails sent, they are great measures to avoid the spam box and cultivate a high reputation as sender. Every system I prepare for an application, I do all this work involving the DNS records and the signatures mentioned, and the result is usually "Inbox", that is, no box of spam.

Ethical use

Also very important is as your server/application will do the uploading. Bought a list of millions of emails and sent the same ad to everyone? Reputation will plummet and shipments will be classified as spam. On the other hand, if your system is behave well, sending emails only to those who legitimately interact with your system, with "double opt-in" (i.e., email confirmation/verification by sending a link), And by following too many ethical "behavior" rules, with no wrongful submissions, you’re building an excellent reputation. The maintenance of the e-mail register is another important task: sending emails to non-existent addresses, for example, inevitably happens with time, and it is important to follow the bounces (returns), keeping the email registration database always as clean as possible.

The number of recipients can be huge as long as your "list" has been built over time and is "true". Send a lot of emails suddenly to a lot of addresses... is spam.

When migrating a medium or large user base, from one provider to the other, you need to make sure with the provider the rules of use for sending emails. I have already negotiated with more than one provider and our server has been put on the white list, by the fact that we follow the best practices in sending (in this case, sending daily spiritual messages to about 6000 addresses - all registered willingly, with double opt-in, etc.). Usually providers have a control/filtering/limit mechanism, but can be disabled upon request, making it possible to send in larger quantities.

Cuidados Técnicos

Following the above guidelines and a few more technical precautions in sending the messages (Return-Path correct and valid, sender’s address correct and valid, SMTP protocol dialog correct), becomes almost irrelevant the contents email, if your email is really honest and appropriate... in other words: if your email really don’t be spam, then it is very difficult to be classified as spam due to contents. (That being said, of course there are several tips that boil down to nothing more than "common sense", avoiding excessively "promotional" language, or obscene words, etc.)

Compatibility between readers

Your point questions, except about the number of recipients we’ve seen, are about: content-type, CSS, images, and mail() x Phpmailer.

These are pertinent and important questions, but very little relevant to the punctuation as SPAM or not. In fact, an email that is just HTML with an image, no text at all, can be considered suspicious. Other than that, the answer is "whatever", considering the question of punctuation as spam.

These questions are important yes to build emails that are correctly presented in as many environments as possible: Outlook, Thuderbird, Gmail, Yahoo, and other email readers, which are many. There yes these answers need to be sought and best practices should be followed.

The best practices of HTML to e-mail are quite different from those for websites on the web. In fact, they are even opposed. And they depend a lot on what you want. For simple transactional emails, it is sometimes preferable not to use HTML, and stick to plain text. You can also base yourself on the model of big sites like Twitter, Facebook, Google, etc. - as far as HTML is concerned.

CSS must be inline (attribute style). In general, the use of image should be restricted to decoration, and not be the main one. But it depends: if your mailing is product catalog, it may be important to have product images.

The mail() function can be used, but libraries like Phpmailer or others make coding a lot easier and a good option. I think the most important thing is the structure "behind"... I usually install and configure Postfix to make the submissions...

E-mail Deliverability is a broad and extensive topic... hope to have helped a little.

  • Broad, extensive and often painful. + 1 for remembering the reputation of the IP. The goat often has no fault of the bullshit committed by the "neighbor of lodging"

  • Very interesting to know about IP reputation and DNS records, I’ve spent hours trying to understand why emails generated on a given cloud server, were always classified as spam, and is not a cheap server as you mentioned, thanks for the information.

  • To be more precise, of the 6 VPS providers I’ve used, only 1 of them had this problem of the submissions being immediately and irretrievably rejected because of reputation. Doing justice: have VPS provider "cheap" (5 dollars per month) that has no problem either...

12

There are several questions you have there. I will try to answer in the best way possible.

Remembering that depending on the case, the use of services such as the Mailchimp is the best option. The most basic plan is free and as your need grows, plans become more "parrudos".

  1. Which correct email header formatting $headers .= "Content-type:text/html... ?
    $headers = "Content-type: text/html; charset=iso-8859-1 r n";

  2. You can use CSS to style?
    Yes, but this preferably stays in html.

  3. The use of image is allowed, which is the best way to use?
    Yes, it is. However, the use of tags is highly recommended Alt and do not resize the images. If you need them smaller, use photoshop.

  4. There is a limit of recipients?
    No, although it is prudent to separate recipients into multiple groups and always include their test email, to make sure that the submission went well.

  5. It is best to use the mail() function, or a class like Phpmailer for authenticated email sending?
    Personally I would use Phpmailer. But then I fell for opinions, so I won’t even try to defend the method.

Additionally, I found a link containing 20 best practices tips on creating email marketing. I think we should list some:

  • Do not use background images;
  • Do not exceed 600px width - Most people who use outlook for example do not open their emails. Why stick a scroll bar instead of showing the whole message?
  • Test your application to know if emails are being sent to all providers;
  • Test your application in several browsers.

Good luck.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.