0

我正在使用 CodeIgniter 发送电子邮件并使用 CPanel。这是我在 application/library 文件夹中 email.php 文件中的代码,并将电子邮件设置为自动加载。

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$config['smtp_host'] = 'localhost';
$config['smtp_port'] = '25';
$config['smtp_user'] = 'info@mydomain.com';
$config['smtp_pass'] = 'mypassword';
$config['validation'] = TRUE;

以下是我发送电子邮件时的代码。

$this->email->from('noreply@mydomain.com', 'mydomain.com');
$this->email->to($rescue_email);
$this->email->bcc('support@mydomain.com');
$this->email->subject('mydomain- Request a new password');
$this->email->message($message);            
$this->email->send();

不知道为什么发不出去?在它正确发送之前。

当我使用时,

echo $this->email->print_debugger();

是显示器,

Your message has been successfully sent using the following protocol: sendmail
User-Agent: CodeIgniter
Date: Wed, 20 Feb 2013 08:31:42 +0100
From: "mydomain.com" 
Return-Path: 
To: recipient@email.com
Bcc: support@mydomain.com
Subject: =?iso-8859-1?Q?mydomain_-_Request_a_new_password?=
Reply-To: "noreply@mydomain.com" 
X-Sender: noreply@mydomain.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <51247bdee59ff@mydomain.com>
Mime-Version: 1.0

电子邮件发送成功。我在邮箱中查看我看不到的任何东西,但在垃圾邮件箱中。

4

0 回答 0