Reputation: 7505
I am using Symfony 1.4.8 and Propel as ORL. I am sending mails using Symfony miler object, the mail is send properly but it goes to spam folder, is there any way to stop that. the code that i am using,
$to_email_array=array("[email protected]","[email protected]");
$body="welcome to symfony";
$subject="from Symfony";
$from=array('[email protected]' => 'our Domain');
$mail_object=$this->getMailer();
$message=Swift_Message::newInstance()
->setSubject($subject)
->setBody("<html> <head> </head> <body> <span>Dear {receiver}, </span>".$body."</body> </html>", "text/html")
->setFrom($from)
->setTo($to_email_array);
$mailed=$mail_object->batchSend($message);
The above code is called from a Symfony Task, and we are using our own web server to send mail, with our domain name. The mail is send, but it goes to spam folder. Is there any way to stop the mail going to spam folder.
Upvotes: 2
Views: 4783
Reputation: 1647
Spam filtering can be either based on infrastructure problems, or on message content. You will need to tell us more about your setup, or try a few things, to work out where the problem is:
Do you have a unique IP for your web server, and you have reverse DNS set up for your web server IP?
Do you have a SPF record in DNS designating your web server as authorized to send email for your domain? If you're not sure what I mean, you can read this: http://www.open-spf.org/Tools/
Which email service(s) or client(s) are junking/bouncing the emails? Are there any added message headers indicating what filter rules were matched?
Upvotes: 5
Reputation: 7685
What I generally find to work for me is to specify all addresseses (To, From, Cc, etc) in RFC822 format, like so:
To: "John Doe" <[email protected]>
Upvotes: 0
Reputation: 57184
You need to setup DKIM and SPF which can be done easily by watching this video. Those will allow other sites to verify emails actually came from you and can be trusted.
Upvotes: 0