我想通过电子邮件类在与Gmail笨发送电子邮件,但我得到以下错误:在笨通过电子邮件类发送电子邮件使用Gmail
错误:
A PHP Error was encountered
Severity: Warning
Message: mail() [function.mail]: Failed to connect to mailserver at "ssl://smtp.googlemail.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
Filename: libraries/Email.php
Line Number: 1553
这是我在全功能控制研究:
function send_mail(){
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'xxxxxxx';
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'Negin Phosphate Shomal');
$this->email->to('[email protected]');
$this->email->subject('This is an email test');
$this->email->message('It is working. Great!');
if($this->email->send())
{
echo 'Your email was sent, successfully.';
}
else
{
show_error($this->email->print_debugger());
}
}
我php.ini
改变SMTP,因为这:
SMTP = ssl://smtp.googlemail.com
smtp_port = 25
我该怎么办?
对于
我猜SMTP端口应为465 – 2012-03-05 09:41:52