Sending emails that don't get categorized as spam

I’ve been working on a script which sends order confirmation emails to customers. Upon testing it, I have noticed the emails are often categorized as spam/junk mail. How can I prevent this?

If you haven’t already done so, do some research on the www on keywords and phrases and their locations within emails that spam filters search for to detect spam and then make sure the content of your emails don’t contain those keywords or phrases in those locations.

2 important steps:

  1. send your emails from IP address that has reverse dns entry (google about it first)

  2. If you sending email from web apps, like from a web form, then your webserver is the one who is sending emails. Spam filters don’t like that. The way they know it’s from a web server is because most apache servers run under the user ‘nobody’
    All you have to do is create regular account on your server like ‘johnny’ then run your apache under this user. All your emails will have johnny@yourdomain in their return-path header. This is the most important header for spam filters.

  3. Don’t use spammy keywords in email body or subject line

  4. Plain text emails are less likely to be marked as spam than html emails.
    There are more tricks but these 4 are the essential rules to follow.