我已经遵循一个教程来发送邮件从PHP。邮件不发送在php
public function send_credentials($beneficiary_user){
$this->load->library(‘email’);
$email_config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => '465',
'smtp_user' => '[email protected]',
'smtp_pass' => 'apptesting',
'mailtype' => 'html',
'starttls' => true,
'newline' => "\r\n"
);
$this->email->from('[email protected]', 'invoice');
$this->email->to('[email protected]');
$this->email->subject('Invoice');
$this->email->message('Test');
$this->email->send();
}
什么其他的设置,我必须做,使之工作 *回声运行后$这个 - >的电子邮件 - > print_debugger();.我得到了*
无法使用PHP邮件()发送电子邮件。您的服务器可能未配置为使用此方法发送邮件。
User-Agent: CodeIgniter Date: Sun, 9 Feb 2014 14:58:44 +0530 From: "invoice" Return-Path: Reply-To: "[email protected]" X-Sender: [email protected] X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_52f74a4c41e88" =?utf-8?Q?Invoice?= This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_52f74a4c41e88 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Test --B_ALT_52f74a4c41e88 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Test --B_ALT_52f74a4c41e88--
你可以描述你所得到的错误,无论是在控制台还是在你的错误日志中 –
你对'$ email_config'数组没有做任何事情。当你实例化它时,你应该将它传递给电子邮件库。 – Mark
调用'$ this-> email-> initialize($ config);'初始化你设置的配置变量,或者在构造函数中传递它''this-> load-> library('email',$ config);' –