任何人都幸运地将 ActionMailer 配置为通过 Zoho 帐户发送电子邮件?
这些是我的设置:
ActionMailer::Base.smtp_settings = {
:address => "smtp.zoho.com",
:port => 465,
:domain => 'example.com',
:user_name => 'steve@example.com',
:password => 'n0tmypa$$w0rd',
:authentication => :login
}
但是,调用 .deliver 超时:
irb(main):001:0> AdminMailer.signup_notification('asfd').deliver
Timeout::Error: Timeout::Error
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:929:in `recv_response'
from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:552:in `block in do_start'
from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:939:in `critical'
from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:552:in `do_start'
from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:519:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mail-2.4.4/lib/mail/network/delivery_methods/smtp.rb:144:in `deliver!'
帮助文档说使用端口 465 和 SSL 身份验证。我试过有无,:enable_starttls_auto => true
但它仍然超时。
具体来说,文档指定了以下设置:
> Email Address: Username@yourdomain.com
> User Name format: Username@yourdomain.com
> Secure Connection (SSL) Yes
> Outgoing Mail Server Name: smtp.zoho.com
> Outgoing Port No.: 465
> Outgoing Mail Server requires authentication: Yes
有任何想法吗?
ps 我已将 Outlook 配置为使用帮助文档中的设置,并且外发电子邮件工作正常。telnet 到 smtp.zoho.com 465 也可以连接。