email - PHP mail going to spam folder in Gmail -


my code looks this

$to = "mymailid@gmail.com"; $subject = "sample subject"; $body = "<div> hi hi .. </div>"; $headers = "reply-to: sender <mymailid@gmail.com>\r\n";  $headers .= "return-path: sender <mymailid@gmail.com>\r\n"; $headers .= "from: sender <mymailid@gmail.com>\r\n";  $headers .='x-mailer: php/' . phpversion(); $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n";   mail($to, $subject, $body,$headers) 

i have sent suitalbe header in mail function. everytime when run code, mail go spam folder in gmail account.. how avoid mail going spam folder?

it can fixed passing complete header information informing mail provider sender trusted domain (https://en.wikipedia.org/wiki/domainkeys_identified_mail) dns settings involved.
can find detail information here:

http://www.velvetblues.com/web-development-blog/avoid-spam-filters-with-php-mail-emails/

https://www.digitalocean.com/community/questions/email-goes-to-spam-gmail-php


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -