In this tutorial, you will learn how to make your emails land directly to inbox.

Sending emails with PHP is easy. All you need is a function and three arguments.
mail($admin_email, “$subject”, $comment, “From:” . $email);
While this is all you need, it is not all enough  to normal email messages. Any closer look  than a mere glance will reveal that the basic use of the PHP email function does not set the “From:” header line.

The mail() function included with stock PHP does not support SMTP authentication, for example. If mail() does not work for you then for this or another reason, try the PHPMailer package, which is much more comprehensive while maintaining, to a large extent, the simplicity and ease of mail() for sending mail from PHP.
Mark the following points then proceed to code.

Use MailGet – Email Service Provider to send bulk email.  MailGet has advance algorithm, necessary headers and spam protection technique to get you maximum Inbox delivery.

Mail Header

A ‘header’ is the technical information that is added to email messages such as sender, subject and time of sending.
This information is picked up by the receiving mail server and is processed in the delivery and display of the email. Senders can also add headers to emails themselves in order to give instructions to the receiving system (mail server). This information cannot be seen by the recipient (unless he starts digging into the HTML source code). For example, a DKIM header is added to prove to the receiving mail server that a sender is authentic.

To ensure delivery of your email directly to user’s inbox, you must insert required and proper header at the place.

Standard syntax for header is, {Header-name: header value}.

Following are the various headers:

$headers='From: [email protected] \r\n';
$headers.='Reply-To: [email protected]\r\n';
$headers.='X-Mailer: PHP/' . phpversion().'\r\n';
$headers.= 'MIME-Version: 1.0' . "\r\n";
$headers.= 'Content-type: text/html; charset=iso-8859-1 \r\n';
$headers.= "BCC: $emailList";
$headers.= "CC: $emailList";

From: The senders email address.

Reply-To: The email address where replies should be sent to.

Return-Path: Kind of the same thing as the Reply-To. Some email clients require this, others create a default.

X-Mailer: The message was sent using PHP, version 2.32.

MIME: Multipurpose Internet Mail Extensions () is an Internet standard that extends the format of email to support:

  • Text in character sets other than ASCII.
  • Non-text attachments: audio, video, images, application programs etc.
  • Message bodies with multiple parts
  • Header information in non-ASCII character sets.

Content-type: Tells the content type of message is plain text or HTML, also the character set used.

BCC: Blind Carbon Copy. A comma separated list of more recipients that will not be seen by any other recipients.

CC: Carbon Copy. A comma separated list of more recipients that will be seen by all other recipients.

Pass ( [email protected] designates as permitted sender);
envelope-from=<[email protected]>;
helo=host name, given in the HELO or EHLO command;

Carriage Return/Line Feed is must to place each header in a new line.It is /r/n.

An example of a simple message with extra headers could look like this:

<?php $to = "[email protected]"; //argument 1
$subject = "Hi!"; //argument 2
$body = "Hi,\n\nHow are you?"; //argument 3
$headers = "From: [email protected]\r\n" . "X-Mailer: php"; //mail headers
if (mail($to, $subject, $body, $headers)){
echo("<p>Message sent!</p>");
else {
echo("<p>Message delivery failed...</p>");
} ?>

If you want to dig deeper, here are the definitions:

IP Address

If you are sending email from a new or cold” IP address, the various ISPs have no basis from which to assign you a sending reputation. Since this reputation will eventually determine whether or not your emails will get pass their SPAM filters, it’s obviously pretty much important. In the case that you are sending a very low volume (e.g., < 10,000 emails/month) of email, you will likely stay off the ISPs’ radars for the most part. However, if you are exceeding this approximate threshold, you should make the warmup process a priority in order to play it right.

Often times, the history of your IP is also an important determinant of an ISPs initial evaluation. Here are a few tools you can use to check the reputation of any IP: Return Path’s and Cisco’s IronPort

What does it actually mean to “warm up” an IP address?
IP warming is a gradual process that happens over time, with the goal of establishing a reputation as a legitimate email sender in the eyes of ISPs (Internet Service Providers). When an ISP observes email suddenly coming from a new or “cold” (ie, recently dormant) IP address, they will take notice of it and immediately begin evaluating the traffic coming from that IP. Since volume is perhaps the most telling factor in the eyes of ISP SPAM filters, it is best to begin sending low to moderate volume (e.g., up to 1 million emails/month), eventually working your way up to larger volumes (e.g., over 1 million emails/month). This gives the receiving email providers a chance to closely observe your email sending habits and the way your customers treat the emails they receive from you.

It should be noted that taking this gradual, ramping approach does not guarantee smooth sailing forever more. It remains important to follow best email practices – send acceptable content that your users want to get, maintain quality lists and send your email on a consistent basis.

Spam and Bounce

If your  messages are skipping Inbox, the cause is a misconfigured filter or a setting on your Forwarding and POP/IMAP tab.Also,

  1. Update the SPF record on your DNS.
  2. As long as the from address is valid most email providers will allow them to be delivered, but security settings are an individual choice.
  3. If you’re on a shared host, consider buying a unique IP for yourself, because others using your IP may have gotten your IP blacklisted for spam.
  4. Ensure you do not send more than 250 emails to each provider per hour, as your reputation (of your IP) grows with the email providers you can up this number

Unsubscribe link

Modern email services like Gmail and have made great strides against spams, and it shouldn’t reach inbox very often.
Including an Unsubscribe button for senders with a good reputation will reduce “false-positive” spam complaints, reduce customer service requests, and improve the experience for your customers.

How To Add Unsubscribe Link?

Place an anchor tag in your email content with hyper-reference to a page, that will process the removal of a user from your mailing list.

<a href="">Unsubsribe</a>

An Email Unsubscribe Link added by the sender can be mistrusted by recipients every now and then. Giving them the idea ‘they are only in it to sell, so they won’t process my request’. An unsubscribe link in the interface of the email client will seem more reliable.

Finally, spam filters will be positively affected when they see a list-unsubscribe header in your email. Your emails will pass through to the inbox more easily. The list-unsubscribe header is a kind of guarantee that you are a legitimate sender.

List-Unsubscribe: <mailto:[email protected]>, <>

Unsubscribe user filter

Check for spam filters, if you have set If the mailbox is using spam filter set by the user, then there will be a strict criteria to pass through it. In your e-mail header, include something unique to the recipient that is, therefore, unlikely to be in a spam message.
Avoid the use of background colors, large or unusual fonts, or more than one font. In other words, don’t make your email look like an advertisement or a brochure.Spam filters are wary of link-laden messages because spammers tend to scatter links around their messages, hoping that the reader will click on at least one.


Spam filters use a lot of different criteria to judge incoming email.Because different spam filters can function slightly differently, it can be difficult to nail down the exact criteria for judging spam.
Subject lines that are irrelevant or contain a lot of capital letters and excessive punctuation tend to trigger spam filters. Avoid words like “free,” “act now,” “limited time,” or “click now.”


You should aim for clean, minimally formatted emails that emphasize your content. Unfortunately, there is no complete list of spam trigger words. Further, it is not always the case that your email will end up in the spam filter simply by using a so-called trigger word.

This is a common, and easily preventable, cause for landing in the spam folder. Not only this is a good practice for avoiding a spam filter, but it also covers you in the case where the recipient cannot view HTML emails.


Make sure that you fulfill all aspect of  not being a spammer, then there will be very minimal chances that your email won’t arrive into an inbox.Still nothing is always perfect at once.So try more and more and keep visiting our blogs for new and updated posts.Thank you!

You may also like –