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
LVL 1
rgb192Asked:
Who is Participating?
 
Mark BradyPrincipal Data EngineerCommented:
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
 
Mark BradyPrincipal Data EngineerCommented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
Mark BradyPrincipal Data EngineerCommented:
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
 
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 BradyPrincipal Data EngineerCommented:
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
 
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 BradyPrincipal Data EngineerCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.