Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 在1和1主机上使用Codeigniter发送SMTP电子邮件_Email_Codeigniter_Smtp_Shared Hosting - Fatal编程技术网

Email 在1和1主机上使用Codeigniter发送SMTP电子邮件

Email 在1和1主机上使用Codeigniter发送SMTP电子邮件,email,codeigniter,smtp,shared-hosting,Email,Codeigniter,Smtp,Shared Hosting,我正在尝试通过1和1上托管的codeigniter网站上的SMTP发送电子邮件。当我在本地执行此操作时,它工作得很好,但当我从我的1和1主机尝试时,我得到一个错误 这是我的配置: $config['protocol'] = 'smtp'; $config['smtp_host'] = 'auth.smtp.1and1.fr'; //i'm in france and this is the SMTP server adress 1and1 gave me. $config['smtp_port'

我正在尝试通过1和1上托管的codeigniter网站上的SMTP发送电子邮件。当我在本地执行此操作时,它工作得很好,但当我从我的1和1主机尝试时,我得到一个错误

这是我的配置:

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'auth.smtp.1and1.fr'; //i'm in france and this is the SMTP server adress 1and1 gave me.
$config['smtp_port'] = 25;
$config['smtp_user'] = 'user@mydomain.com';
$config['smtp_pass'] = 'password';
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'auth.smtp.1and1.fr'; //i'm in france and this is the SMTP server adress 1and1 gave me.
$config['smtp_port'] = 25;
$config['smtp_user'] = 'user@mydomain.com';
$config['smtp_pass'] = 'password';
下面是错误:

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:

from: 

The following SMTP error was encountered:
Unable to send data: RCPT TO:

to: 

The following SMTP error was encountered:
Unable to send data: DATA

data: 

The following SMTP error was encountered:
Unable to send data: //details about my message i removed
Unable to send data: .

The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
然后我尝试使用smtp.1和1.com而不是auth.smtp.1和1.fr。令人惊讶的是,它成功了,但执行起来却花了30秒!(在我的本地主机上,它是即时的)


有什么建议吗?

与他们的支持人员交谈。他们可能对港口有限制。或者使用sendmail。

如果您的托管服务器和电子邮件服务器位于同一位置,则不需要进行smtp身份验证

因此,请从配置文件中删除以下代码,将所有内容保留为默认值并执行您的功能。为我工作。在这种情况下应该对你有用