我目前正在尝试使用Bolt CMS建立一个网站。对于简单的联系表单,我正在尝试使用“SimpleForms”扩展。为此,我似乎必须在“config.yml”中设置“mailoptions”字段。
现在,对于邮件主机,我使用Zoho Mail。我已成功建立帐户,验证了我的域名等。我在配置中的当前mailoptions值如下所示:
mailoptions:
transport: smtp
host: smtp.zoho.com
port: 465
username: ****
password: ****
auth_mode: null
encyption: null
senderMail: null
senderName: null
请注意,我显然只是插入了一些用户名和密码应该去的星号:-)
现在,我不确定最后4个字段允许的值。我没有为我的生活能够找到任何关于此的文件。但是,如果我只是尝试使用这些设置通过SimpleForms联系表单发送电子邮件,则会收到以下错误:
Swift_TransportException:连接到smtp.zoho.com:465 Timed Out
再次,未能找到有关此问题的更多信息。我最初的猜测是,它可能与我没有正确设置最后4个字段有关,但我只是不知道它们应该是什么:(我所知道的,从遵循DigitalOcean教程(我使用DigitalOcean作为服务器主机) ),设置应该如下:
我为auth_mode和加密尝试了不同的值,例如:
但是,这仍然给我相同的超时错误。
[编辑]
所以,我能够找到值的实际文档(与Swiftmailer相关)。我当前的设置如下所示:
mailoptions:
transport: smtp
host: smtp.zoho.com
port: 465
username: ****
password: ****
auth_mode: login
encyption: ssl
senderMail: **** (The same as the username email)
senderName: **** (The name of the email account holder)
我还仔细检查了Zoho自己的网站HERE的邮件设置。
这一切似乎是正确的设置,但我仍然得到原始的超时消息:(
编辑
检查答案的评论我的愚蠢错误:)
Bolt只通过Silex服务提供商使用Swiftmailer。 Silex documentation page可能有您正在寻找的答案......即:
可以设置以下选项:
host:SMTP主机名,默认为“localhost”。
port:SMTP端口,默认为25.用户名:SMTP用户名,默认为空字符串。
password:SMTP密码,默认为空字符串。
加密:SMTP加密,默认为null。有效值为'tls','ssl'或null(表示不加密)。
auth_mode:SMTP身份验证模式,默认为null。有效值为“plain”,“login”,“cram-md5”或null。
对于遇到此问题的任何人,如果存在禁止传出SMTP的安全设置,请与您的主机核实。