发邮件问题
发邮件的时候总是报错,不知道什么原因。220 163.com Anti-spam GT for Coremail System (163com)
hello: 250-mail
250-PIPELINING
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
Failed to authenticate password. Error: 550
from: 550
The following SMTP error was encountered: 550
to: 503 bad sequence of commands
The following SMTP error was encountered: 503 bad sequence of commands
data: 503 No sender.
The following SMTP error was encountered: 503 No sender.
502 Error: command not implemented
The following SMTP error was encountered: 502 Error: command not implemented
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: Code Igniter
Date: Mon, 8 Sep 2008 16:14:59 +0800
From: "xxx"
Return-Path:
To: xxx@sina.com
Subject: Email Test
Reply-To: "xxx@163.com"
X-Sender: xxx@163.com
X-Mailer: Code Igniter
X-Priority: 3 (Normal)
Message-ID: <48c4df0378459@163.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Testing the email class
代码如下:
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['smtp_host']= 'smtp.163.com';
$config['smtp_user']= 'luxin-haodan@163.com';
$config['smtp_pass']= 'luxinhaodan';
$this->email->initialize($config);
$this->email->from('luxin-haodan@163.com','luxin');
$this->email->to('luxinhaodan@sina.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class');
$this->email->send();
echo $this->email->print_debugger(); 换成sina的smtp服务器,又提示我超时:
Fatal error: Maximum execution time of 30 seconds exceeded in d:\workspace\sainet\system\libraries\Email.php on line 1502 smtp 发邮件你基本可以放弃了,如果你没有自己的 SMTP 服务器的话。
很多 SMTP 都需要反向解析的,你如果没有就是垃圾邮件发送者。
还有其他的检查,总之你用别人的 SMTP 你就别想了。 Codeigniter1.6.3支持Gmail的。用Gmail来发信吧。当然主机要支持SSL。
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_user'] = 'your_email@gmail.com';
$config['smtp_pass'] = 'your_password';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '5';
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
可以参考一下 华领GPS车辆管理系统 实例,论坛有下载,里面采用了TOM和GMAIL两种方式发MAIL,就是为了演示。 163现在关闭smtp了,用不了SMTP的 在有的人机器上就能发送成功,所有的配置都一样的。为什么到我这就报下面的错误。郁闷
Fatal error: Maximum execution time of 30 seconds exceeded in d:\workspace\sainet\system\libraries\Email.php on line 1502 我是自己配置的公网邮件服务器,然后用 mail 方式发送成功的。 增加
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
即可在Windows机器上发送成功。 我的成功了,用的是tom的,发信没问题,还可以
可以加我qq:646282808详谈,服务器类的就别问我了 使用qq邮箱smtp方式发送成功。
貌似$this->email->from('xx@qq.com', 'xx'); 要写自己的真实邮箱即可。
页:
[1]
2