简体   繁体   English

为什么我的CodeIgniter应用程序不通过smtp发送电子邮件?

[英]Why isn't my CodeIgniter app sending emails on smtp?

I'm trying to send mail using CodeIgniter. 我正在尝试使用CodeIgniter发送邮件。 I don't get any errors; 我没有任何错误; in fact I get the success message designed in the system, but the email won't go through. 实际上,我收到了系统中设计的成功消息,但电子邮件不会通过。 The form details, however, get recorded in my database. 但是,表单详细信息已记录在我的数据库中。 Can you help me fix this please? 你能帮我解决这个问题吗? Thanks in advance. 提前致谢。

I'm trying to send the mail using a GoDaddy shared hosting by the way. 我正在尝试使用GoDaddy共享托管发送邮件。

Here's my email.php configuration: 这是我的email.php配置:

<?php

        $config = array(

          'protocol' => 'smtp',
          'smtp_host' => 'server',
          'smtp_port' => 80,
          'smtp_timeout' => 7,
          'smtp_user' => 'blabla', 
          'smtp_pass' => 'blabla', 
          'mailtype' => 'html',
          'charset' => 'utf-8',
          'newline' => "\r\n",
          'wordwrap' => TRUE

        );?>

SMTP端口通常是25、2525或587。更改SMTP端口号应该可以解决您的问题。

GoDaddy has a tendency to lock down alot on their shared hosting. GoDaddy倾向于锁定大量共享主机。 There is a similar Stack Overflow answer here: 这里有一个类似的堆栈溢出答案:

https://stackoverflow.com/questions/13219209/codeigniter-email-class-with-godaddy-email-hosting-issues https://stackoverflow.com/questions/13219209/codeigniter-email-class-with-godaddy-email-hosting-issues

Another option is using a third party SMTP service. 另一种选择是使用第三方SMTP服务。 I have GoDaddy hosting myself and I use SMTP2Go. 我让GoDaddy托管自己,并且使用SMTP2Go。

I had to use port80.smtpcorp.com as my host and port 443. 我必须使用port80.smtpcorp.com作为主机和端口443。

Hope that information helps! 希望信息有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM