用户
 找回密码
 入住 CI 中国社区
搜索
查看: 11082|回复: 11
收起左侧

发邮件问题

[复制链接]
发表于 2008-9-8 16:17:14 | 显示全部楼层 |阅读模式
发邮件  的时候总是报错,不知道什么原因。
220 163.com Anti-spam GT for Coremail System (163com[071018])

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();
 楼主| 发表于 2008-9-8 16:19:56 | 显示全部楼层
换成sina的smtp服务器,又提示我超时:
Fatal error: Maximum execution time of 30 seconds exceeded in d:\workspace\sainet\system\libraries\Email.php on line 1502
发表于 2008-9-8 16:32:34 | 显示全部楼层
smtp 发邮件你基本可以放弃了,如果你没有自己的 SMTP 服务器的话。
很多 SMTP 都需要反向解析的,你如果没有就是垃圾邮件发送者。
还有其他的检查,总之你用别人的 SMTP 你就别想了。
发表于 2008-9-8 16:41:28 | 显示全部楼层
Codeigniter1.6.3支持Gmail的。用Gmail来发信吧。当然主机要支持SSL。

PHP复制代码
$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,就是为了演示。
发表于 2008-9-8 16:42:57 | 显示全部楼层
163现在关闭smtp了,用不了SMTP的
 楼主| 发表于 2008-9-8 18:11:10 | 显示全部楼层
在有的人机器上就能发送成功,所有的配置都一样的。为什么到我这就报下面的错误。郁闷

Fatal error: Maximum execution time of 30 seconds exceeded in d:\workspace\sainet\system\libraries\Email.php on line 1502
发表于 2008-9-8 18:35:30 | 显示全部楼层
我是自己配置的公网邮件服务器,然后用 mail 方式发送成功的。
发表于 2009-3-3 16:20:32 | 显示全部楼层
增加

$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";

即可在Windows机器上发送成功。

评分

参与人数 1威望 +2 收起 理由
Hex + 2 我很赞同

查看全部评分

发表于 2009-3-12 11:47:13 | 显示全部楼层
我的成功了,用的是tom的,发信没问题,还可以
可以加我qq:646282808详谈,服务器类的就别问我了
发表于 2011-9-21 23:29:54 | 显示全部楼层
使用qq邮箱smtp方式发送成功。

貌似$this->email->from('xx@qq.com', 'xx'); 要写自己的真实邮箱即可。

本版积分规则