php - Mails are coming under spam folder using wp_mail function in wordpress -


i using wp_mail function sending emails registration, have tried gmail, email goes spam folder, have tried similar questions answers not working me please help.

$headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "from: noreply@example.com"."\r\n";  $message = sprintf(__('dear: %s'), $user_login) . "\r\n\r\n"; $message .= sprintf(__('the email sent automatically ')); $message .= network_home_url('/');  $message .= __('please visit following link register email address') . "\r\n\r\n"; $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login')."\r\n";   if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), nl2br($message), $headers ) )         wp_die( __('the e-mail not sent.') . "<br />\n" . __('possible reason: host may have disabled mail() function.') );      return true; 

your email contains phrases, common spam emails. mail servers anti-spam filters detects , send junk email folder.

the best can rework content of email (do not include bullshit words dear... or please visit following link..., these @ top of anti-spam filter list, use targeted , personalized appeal, etc, quality of content crucial factor).

as has been said - there no special function mark outgoing email not spam, if exists - spammers use hell.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -