Among the most widespread issues about the webmaster’s work the terminal mail delivery can be mentioned specifically.
This article is about some tips on proper server settings, script installations and such, which helps avoiding cases when some important corporative letters fall into the SPAM folder. By following these instructions, you are going to minimize the probability of your letters getting into the folder of unwanted junk mail.
This article is about some tips on proper server settings, script installations and such, which helps avoiding cases when some important corporative letters fall into the SPAM folder. By following these instructions, you are going to minimize the probability of your letters getting into the folder of unwanted junk mail.
Correct headers
First off, while sending any letter using scripts, avoid leaving the title field empty. If you work with PHP it’s highly not recommended sending «bare» messages with no titles such as mail("[email protected]", "My Subject", "My Message");These are the letters most probably to fall into the SPAM folder.
A quality letter has to contain at least the following features:
- From: Perfecto Web < [email protected] >
- Reply-To: Perfecto Web < [email protected] >
- X-Mailer: Php_libMail_v_1.5
- Content-Type: text/html; charset=utf-8
- Mime-Version: 1.0
NOTE: IP address of the mail sending program should be identical to the domain’s IP address.
To create appropriate titles you may use some completely prepared libraries: PHPMailer, Swift Mailer, libmail.
To create appropriate titles you may use some completely prepared libraries: PHPMailer, Swift Mailer, libmail.
Sending through SMTP
SMTP is a protocol used to send email.Thus protocol is responsible for the data transcription between client → server, server → server and server → client.
To start with, you have to create an e-mail box at your server. Say, [email protected]. Thereafter, you set a PHP script onto authentication via SMTP.
Normally, your SMTP settings are these:
- Host: mail.your_domain or smtp.your_domain
- Port: 25 (alternate port 25025)
- Username: [email protected]
- Password: your_password
Mail transfer through SMTP is the most reliable and safe.
Refer to your hosting-provider to get more info on your SMTP settings.
Refer to your hosting-provider to get more info on your SMTP settings.
The transcription entry PTR
DNS is used to transcribe the domain name into IP address, but it can also perform the opposite process.There is a special in-addr.arpa domain, the records of which are used to transcribe IP addresses into symbolic names. Say, while requesting the perfecto-web.com, DNS servers will redirect you to the following IP address: 178.208.75.66. However, dealing with PTR you have an reverse converting, and requesting for the IP 178.208.75.66 DNS servers will get you to the symbolic name: - perfecto-web.com.
Postal services recommend specifying PTR records identically with the mail sending domain.
If you won’t be able to find the PTR settings in the control panel, clarify their location with your hosting provider.
If you won’t be able to find the PTR settings in the control panel, clarify their location with your hosting provider.
SPF-records
If you possess VPS, VDS, or, for whatever reason manage your domain’s DNS by yourself, we recommend you to consider choosing some correct SPF-records for your domain. SPF entry must contain IP address of the server, which holds your website.If your DNS records lacks entry about the SPF, insert the following:
Host: | your_domain. |
Type: | TXT |
Value: | v=spf1 a mx ip4:111.111.111.111 ~all |
SPF record is necessary for decreasing the probability of the messages sent from your domain falling into receivers’ spam folder.
SPF settings aren’t vital, but they are helpful in increasing the chances for your messages to be delivered properly.
SPF settings aren’t vital, but they are helpful in increasing the chances for your messages to be delivered properly.
DKIM setup
SPF & DKIM are somewhat identical technologies, as both of them are designed to confirm the validity of the sender.DKIM - DomainKeys Identified Mail meaning, method of the E-mail authentication.
DomainKeys Identified Mail (DKIM) technology unites several existing anti-fishing and anti-spam methods aimed to improving the email’s qualification level, and legit email identification. Instead of the traditional IP address, in order to define the sender, DKIM adds a digital status into it, connected with the organizational domain name. This signature is automatically checked on at the receiver’s side, after which, so called «white lists» or «black lists» are used to maintain the sender’s reputation.
The DomainKeys technologies use domain names for the senders’ authentication. DomainKeys utilizes an existing domain names system (DNS) to transfer the open encrypting (encoding) keys.
Off we go. To start with, you need to create a couple of keys: public and private. You can do that many ways. For instance, you can use OpenSSL, but we will go specific on the port25.com. Moving to the DKIM Wizard section, in the fields provided you enter the domain name and chose the key size. As you have only one postal server, specify «dkim» in the selector. As of today, Gmail recommends the 1024bite key, so just select it and click «Create the Key».DomainKeys Identified Mail (DKIM) technology unites several existing anti-fishing and anti-spam methods aimed to improving the email’s qualification level, and legit email identification. Instead of the traditional IP address, in order to define the sender, DKIM adds a digital status into it, connected with the organizational domain name. This signature is automatically checked on at the receiver’s side, after which, so called «white lists» or «black lists» are used to maintain the sender’s reputation.
The DomainKeys technologies use domain names for the senders’ authentication. DomainKeys utilizes an existing domain names system (DNS) to transfer the open encrypting (encoding) keys.
Source: Wikipedia
The next screen will show you both public, as well as a step by step guidance on the DKIM alignment. Add the entry into DNS settings.
It must look approximately like the following:
Host: | dkim._domainkey.yourdomain. |
Type: | TXT |
Value: | v=DKIM1; k=rsa; s=email; p=MIGfMA0GCSqGSIb4DQEBAQUAA4GNADCBiQKBgQDgS1AZb9K924hWLVyodfyaQShVyLY0HceJk9JWd+bA3g78a4cEilzZUFu4hBFSX1QGWrloDN/omwz89IfOxl1eUFtqRXiQBaKgBvwIH/qGkKoiGikYj+4ETbdBdHhjDLoNK8PH0YAmNZ2brllGPYEC60QYjf8LG6+KRff7n98RKQIDAQAB |
After the «p=» combination our public key must follow directly.
Private key
Initially, we need to know whether the postal service supports digital subscription of DKIM. Virtually any of the new postal server versions does support it. Otherwise, you can apply to your system administrator or to a specialist, in order to install the mail service with the DKIM support.
We save the previously obtained private key with the extension *.pem. In our case, we came out with «dkim.perfecto-web.com.pem»
You can save the key in /etc/pmta for Linux systems, or in C:/pmta for Windows.
Additional factors
There are many factors able to compromise the letter sender’s reputation, as well as the reputation of the mailbox in general.- We wouldn’t recommend to send messages with iframe !important
- We wouldn’t recommend to send messages from JavaScript !important
- We wouldn’t recommend to send messages with applets and Flash!important
- Always put the alt description for all images in the mail
- Delete all broken links from the website you’re sending the letter on behalf
- Do your best for the letter to show correctly from all possible devices
- Do not send emails to people who have not subscribed to the newsletter !important
- Always insert an unsubscribe link, if doing newsletter !important
- Do not write the entire title in capitals !important
- Use List-Unsubscribe header for transmission links for quick unsubscribe
- Any message must be formatted in accordance with the standards RFC 5322 and HTML