doubai9014 2015-03-09 18:51
浏览 54

Swiftmailer使用代码554引发异常,客户端主机被拒绝

I'm using Swiftmailer to send mail through a contact form with Symfony. My ISP allows me to send mail from a remote server with my mail account information (username, password and smtp). My problem is that when I'm sending a mail from my development site (from my desktop server) I can do it and the mail is sent, but in the production environment Swiftmailer raise an exception saying that the client host is rejected (code 554 5.7.1) and failed to send the mail. I have tried to debug this with the app/console swiftmailer:email:send and I get the same error :

Exception occurred while flushing email queue: 
 Expected response code 220 but got code "554", 
 with message "554 5.7.1 <unknown[here-example-ipv6]:49545>: 
 Client host rejected: Access denied " [] []

The ipv6 (here-example-ipv6) is corresponding to a dns of my host that I have not configured, but I don't understand why Swiftmailer believes that this ip is corresponding to the client host, my configuration seems (app/config/config.yml and parameters.yml) to be good because that's work fine from my desktop. Any help would be appreciated, thank.

  • 写回答

1条回答 默认 最新

  • douwen7516 2015-03-10 15:59
    关注

    Ok, I get it. I was confused with the error message because I thought it was comming from Switmailler, but it was comming from my ISP mail server. The problem was that when you want to send a mail from a remote location my ISP require to activate SSL encryption. So I have added two more parameters for the Swfitmailler configuration :

    port: 465
    encryption: ssl
    

    and now that's fine. But because I was testing from a production environment, the cache has to be cleared in order the changes to take effect.

    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集