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条)

报告相同问题?

悬赏问题

  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题