I am running into a problem while sending out emails from the system and the problem is that the email gets delivered to the spam box in gmail/yahoo/hotmail. I am posting he
This is because when you send a mail with the PHP mail()
function, if you are using a shared host, it will appear in your Received
header. One way is to change your headers that you are sending. This article and this article give a good way to bypass spam filters by changing headers.
For best practices, you should investigate using the Sender Policy Framework (SPF) to avoid being regarded as spam.
You might also be interested in sendmail, which connects to another email account (say, a Gmail account) and sends mail from that account, not from your local server.
Try a search or check related. Most notably, most all is answered here.