• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 518
  • Last Modified:

swiftmail

I have used many phpmailing libraries
and also used sendgrid, constant contact mailing list api


for this project, I need to use swiftmail library

how can I  add additional information to the header so the message is more likely to get delivered
0
rgb192
Asked:
rgb192
  • 5
  • 5
1 Solution
 
Mark BradyCommented:
Here is an article to show you how to edit or work with the headerset() in swiftmail. You can add your own headers via this method. Let me know if this works for you.
0
 
rgb192Author Commented:
>>
http://swiftmailer.org/docs/headers.html


because I am not using an email password
I am just using a server to send emails to customers that bought an item from store, 'thank you for ordering item#5656, your item will be shipped in 3 days'

could you tell me which headers to add so email is less likely to be in spam box
0
 
Mark BradyCommented:
There are a number of reasons why email can be flagged as spam. Things like, are you using a real FROM email address? If you are using (just for example) a gmail.com return address but the email is not originating from googles gmail servers then it will be marked as suspect. There are some good suggestions on how to test your email and how to check to see if your IP is on any blacklist on this page
http://stackoverflow.com/questions/746809/prevent-sent-emails-treated-as-junk-mails-using-php-mail-function
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
rgb192Author Commented:
$header .= "Return-Path: <".$email.">\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; charset=ISO-8859-1\n";

$header .= "X-Mailer: PHP/" . phpversion()."\r\n";

I have been told some of these lines in mail() make the mail less likely to be put in spam

I am asking if I can add to header in swiftmailer so mail is less likely to be put in spam
0
 
Mark BradyCommented:
Yes. I told you some of the reasons why mail can be flagged as spam. I also provided a link that shows you how to add headers to swift mail so I don't understand your last two sentences?
0
 
rgb192Author Commented:
I dont understand which headers to add to lower spam

$header .= "X-Mailer: PHP/" . phpversion()."\r\n";

what is the equivalent in swiftmailer
0
 
Mark BradyCommented:
Oh I see. Well you should not use a noreply@yourdomain.com
Make sure you have a "from" header and a "replyto" header. That should get your mail out of the spam folders but if you have already been placed on a blacklist by someone like Yahoo then you have to contact them and request to be removed or else all of your emails going to their domain will go directly to the junk folders of the account holders.

Watch your subject lines to. Most spam email is trying to sell us pills/drugs or body enhancements so make sure your subjects are genuine. Apart from that you should be just fine. I had to get one of my domains taken off Yahoo's blacklist and all I was doing was testing a script that sends email to myself (my own yahoo account) from my domain. I got on the blacklist and it took me 3 months to get them to remove me. Good luck with that one.
0
 
rgb192Author Commented:
so
Make sure you have a "from" header and a "replyto" header

how can write that I am using swiftmailer and my version php
because some experts think that more information is better to reach the recipients inbox
0
 
Mark BradyCommented:
Well if you posted the code you have I will try to fix it for you. I have never used swiftmailer so I don't even know what it looks like.
0
 
rgb192Author Commented:
I think this works
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now