【问题标题】:Mails are coming under spam folder using wp_mail function in wordpress使用 wordpress 中的 wp_mail 功能,邮件进入垃圾邮件文件夹
【发布时间】:2014-06-02 06:28:29
【问题描述】:

我正在使用 wp_mail 功能发送电子邮件进行注册,我尝试过使用 gmail,电子邮件进入垃圾邮件文件夹,我尝试过类似的问题答案,但它不适合我,请帮助。

$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 was sent automatically by '));
$message .= network_home_url('/');

$message .= __('Please visit the following link to register your 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 could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') );

    return true;

【问题讨论】:

  • 没有神奇的 dont_mark_my_email_as_spam() 函数。如果您已经尝试了许多地方建议的所有方法,那么您就只能这样做了
  • 我正在使用pieregister插件进行注册。

标签: php wordpress email


【解决方案1】:

您的电子邮件包含短语,这在垃圾邮件中很常见。 因此邮件服务器的反垃圾邮件过滤器会检测到这一点并将其发送到垃圾邮件文件夹。

你能做的最好的就是修改你的电子邮件的内容(不要包括像Dear...Please visit the following link...这样的废话,这些在反垃圾邮件过滤器列表的顶部,使用有针对性和个性化的吸引力等,内容的质量是关键因素)。

如前所述 - 没有特殊功能可以将您的外发电子邮件标记为非垃圾邮件,如果它存在 - 垃圾邮件发送者会像地狱一样使用它。

【讨论】:

  • 我试过没有长消息和链接,但它有同样的问题。
  • 我不确定我的 php 邮件发生了什么,有什么我错过安装的吗?
猜你喜欢
  • 2014-12-21
  • 2012-03-03
  • 2011-06-29
  • 1970-01-01
  • 2014-02-18
  • 1970-01-01
  • 2019-04-04
  • 2021-09-04
相关资源
最近更新 更多