PHP Mailer- thenewsletterplugin - wordpress - 来自电子邮件地址

时间:2016-04-15 16:17:06

标签: php wordpress email phpmailer

我的WordPress网站托管在Bluehost上,该网站使用简报插件发送电子邮件DirectX SDK Tools Catalog

Newsletter插件使用PHPMailer发送电子邮件。

来自电子邮件的地址始终是username@bluehost.com

我尝试了这里提到的所有技巧http://www.thenewsletterplugin.com/plugins/newsletter,但这不起作用。

当我创建并运行如下所示的独立PHP页面时,它会从电子邮件地址显示为emailfrom@test.com

<?php

$to      = 'test@test.com';
$subject = 'Test Mail';
$message = 'Test Mail Description';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


mail($to, $subject, $message, $headers, "-femailfrom@test.com");
?>

但它可以使用下面的代码。有没有办法设置它的PHP邮件程序(新闻稿插件),以便它显示从我们的电子邮件,而不是Bluehost&#39>

我尝试将标题更改为以下但同样的错误。

//$r = $this->mail($user->email, $s, array('html' => $m, 'text' => $mt), $headers);
$r = $this->mail($user->email, $s, array('html' => $m, 'text' => $mt),  null, '-f webmaster@example.com');
//mail('nobody@example.com', 'the subject', 'the message', null, '-f webmaster@example.com');

$status = $r ? 0 : 1;

$wpdb->query($wpdb->prepare("insert into " . $wpdb->prefix . 'newsletter_sent (user_id, email_id, time, status, error) values (%d, %d, %d, %d, %s) on duplicate key update time=%d, status=%d, error=%s', $user->id, $email->id, time(), $status, $this->mail_last_error, time(), $status, $this->mail_last_error));

$this->email_limit--;

0 个答案:

没有答案
相关问题