【问题标题】:Can't send mail trough online host server无法通过在线主机服务器发送邮件
【发布时间】:2014-10-14 00:43:42
【问题描述】:

当我通过我的本地设置服务器 (http://bftanker.l) 发送邮件时,电子邮件可以正常工作并到达正确的邮件客户端 (xxx@bftanker.com)。当我将我的网站上传到他们的托管平台时,我总是会收到相同的“客户端超时”错误。

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: ...

有什么建议吗?这是托管平台上某处的复选框还是我有代码错误?

$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

【问题讨论】:

  • 确保您的主机允许来自 PHP 的电子邮件。
  • 这肯定是主机特定问题。
  • 是否有可能以某种方式检查?并对其进行编辑?
  • 您必须联系您的提供商以获取具体说明。

标签: php email hosting


【解决方案1】:

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

【讨论】:

猜你喜欢
  • 2014-01-17
  • 2018-06-30
  • 2011-11-03
  • 1970-01-01
  • 1970-01-01
  • 2012-11-19
  • 1970-01-01
  • 2013-10-28
  • 1970-01-01
相关资源
最近更新 更多