dongtuoleng8624 2015-05-07 10:35
浏览 191
已采纳

Drupal - PHP SMTP设置正确但电子邮件不会发送

I get the following error when my Drupal site tries to send out a welcome email when users are signed up: Failed to connect to mailserver at "secure.emailsrvr.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

I at first set the following in PHP.ini:

 SMTP = secure.emailsrvr.com
    SMTP_PORT = 465
    sendmail_from = support@managerspitstop.com
    username = support@managerspitstop.com
    password = ****

But I still got the error above so I added the following into the mail.inc file which is a file within the Drupal site:

 ini_set("SMTP","secure.emailsrvr.com");
    ini_set("smtp_port","465");
    ini_set("username", "support@managerspitstop.com");
    ini_set("password", "*****");
    ini_set("sendmail_from", "support@managerspitstop.com");

But still get the same error. So I contacted Rackspace who I have set up the email with and they have told me the settings I am using are correct. To test this I added the email to Outlook 2013 send out and email and received an email just fine.

I have looked around and couldn't find a solution. Any help will be greatly appreciated.

  • 写回答

2条回答 默认 最新

  • douzhechi2435 2015-05-07 12:27
    关注

    BLOODY DRUPAL! Managed to get it working. Turns out my email settings were correct the whole time.

    I fixed it by downloading Drupals SMTP module which I placed in httpdocs/sites/all/modules/smtp and then I downloaded phpmailer version 2.2.1 (only required if you are running Drupal 6.x and do not use a version of PHPMailer any higher than 2.2.1 as it will not work) https://github.com/PHPMailer/PHPMailer/releases/tag/v2.2.1 I placed this at httpdocs/sites/all/modules/smtp/phpmailer.

    Once that was sorted I went into the Administration section of my Drupal site and went to the modules section and typed in the email settings and BAM it worked :D.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗