可以通过在线主机服务器发送邮件

时间:2014-10-13 16:17:24

标签: php email hosting

当我通过本地设置服务器(http://bftanker.l)发送邮件时,电子邮件可以正常运行并转到正确的mailclient(xxx@bftanker.com)。当我将我的网站上传到他们的托管平台时,我总是得到相同的#34;客户超时"错误。

The following SMTP error was encountered: 110 Connection timed out
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error: 
Unable to send data: MAIL FROM: ...

有什么建议吗?这是hostplatform上的某个复选框,还是我有代码错误?

$this->load->library('email');
$config['protocol']    = 'smtp';
$config['smtp_host']    = 'smtp.bftanker.com';
$config['smtp_port']    = '2525';

$config['smtp_user']    = 'xxxx@bftanker.com';
$config['smtp_pass']    = 'xxxxxx';
$config['charset']    = 'utf-8';
$config['newline']    = "\r\n";
$config['mailtype'] = 'html'; // or html
$config['validation'] = TRUE;
$this->email->initialize($config);

$this->email->from('xxx@gmail.com', 'Warre Buysse');
$this->email->to('xxxxx@bftanker.com'); 
$this->email->subject('Email Test Local');
$this->email->message('Testing the email.');  
$this->email->send();
echo $this->email->print_debugger();

我正在使用Codeigniter框架。 您可以随意测试表单并在http://www.bftanker.com

上查看print_debugger

1 个答案:

答案 0 :(得分:1)

删除此行:     $ this-> email-> from('xxx@gmail.com','Warre Buysse'); 如果它开始工作,意味着您的主机阻止电子邮件,“来自”字段与smtp用户不同。