我在我的虚拟机上使用 ubuntu。我想使用 catchmail 发送电子邮件,如下所述:http: //berk.es/2011/05/29/mailcatcher-for-drupal-and-other-php-applications-the-simple-version/
我正在尝试发送这样的电子邮件:
//Mailer class:
class Mailer extends PHPMailer
{
public $UTF8Encode = false;
public function __construct($param = null)
{
parent::__construct($param);
$this->Mailer = 'sendmail';
$this->Sendmail = 'smtp://localhost:1025';
$this->From = 'xxxx@xxxx.com';
$this->FromName = 'Support';
$this->WordWrap = 50;
$this->CharSet = 'UTF-8';
}
}
....etc....
和:
//Sending emails
$mail = new Mailer();
$mail->Body = "xxxx";
$mail->Subject = "xxx";
$mail->From = 'xxxx@xxxx.org';
$mail->FromName = 'Support';
$mail->WordWrap = 50;
$mail->AddAddress(xxxx@xxxx.com);
我得到了错误:
Could not execute: smtp://localhost:1025