email - php mail() -> junk, sometimes not even received? -


i using phps mail() function send confirmation e-mails.

the e-mails received on gmail , others far i'm aware, real problems i've had when sending e-mails hotmail or yahoo account.

i have read on internet , many people suggest phpmailer

what guys suggest when sending php mail()? website i'm creating legitimate business , need mail sent , received no matter whom send to.

below code currently, i've used specific headers try solve problems. own own dedicated server , i'm not blacklisted on spam lists, can think of is php itself.

$to = $email; $subject = "subject"; $body = "message"; $headers .= "from: accounts <accounts@site.com>\r\n"; $headers .= "reply-to: <accounts@site.com>\r\n"; $headers .= "x-sender: <accounts@site.com>\r\n"; $headers .= 'x-mailer: php/' . phpversion() . '\r\n'; //mailer $headers .= "x-priority: 3\r\n"; //1 urgentmessage, 3 normal $headers .= "return-path: <accounts@site.com>\r\n"; $headers .= "mime-version: 1.0\r\n";  mail($to, $subject, $body, $headers); 

any appreciated.

regards.

using phpmailer, or swiftmailer or other library won't increase delivery rates in cases: culprit server set up.

sending email notoriously difficult, have read here: http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html basic overview of what's necessary.

yahoo in particular wants dkim set up, , if isp hasn't done you, or on vps, can real pain.

sucessfully sending email takes quite bit more not being on blacklists. default of many isps assume spam until have things set make them think otherwise. guilty until proven innocent.

in codinghorror post, take note of passage:

port25 offers nifty public service -- can send email check-auth@verifier.port25.com , reply from: address extensive diagnostic!

i had use alternate address test work; check-auth2@verifier.port25.com. can read details of why test each address here: http://www.port25.com/domainkeys/

in long run, if you're sending transactional email (ie. not mass mailings email in response user action) recommend service postmark (postmarkapp.com) because @ 1/10th of cent per email, ugly taken care of you.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -