在 Ubuntu 的 Rails 应用程序中选择 SMTP 或 SendMail
我正在尝试遵循本教程 http://edgeguides.rubyonrails.org/action_mailer_basics.html 和底部提供了 SendMail 和 SMTP 的配置选项。到目前为止,这两种方法都不适合我:)
哪一种更常用,尝试其中一种的考虑因素是什么?
此外,在教程中,他们提供了以下格式的配置示例:
:user_name => '<username>',
:password => '<password>'
在我的应用程序中,这些指的是什么?我真的没有密码吗?一旦我弄清楚了它们,我应该保留括号还是不保留?
另外,http主机和smtp主机有什么区别?如何找出我的 smtp 主机的域?我的通用域是 localhost:3000 - 我应该使用它吗?
:address => "domain-of-smtp-host.com"
:domain => "domain-of-sender.com",
谢谢, 亚历克斯
I am trying to follow this tutorial http://edgeguides.rubyonrails.org/action_mailer_basics.html and at the bottom it gives configuration options for SendMail and SMTP. Neither one works for me so far :)
Which one is more commonly used and what are the considerations of trying either one of those?
Also, in the tutorials, they provide examples of configurations in this format:
:user_name => '<username>',
:password => '<password>'
In my application, what are these referring to? I don't really have passwords? And once I do figure them out, should I keep the brackets or no?
Also, what is the difference in http host and smtp host? How do I figure out the domain of my smtp host? My general domain is localhost:3000 - should I just use that?
:address => "domain-of-smtp-host.com"
:domain => "domain-of-sender.com",
Thanks,
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SMTP 是 SendMail 实现的协议。
您需要的是一个您拥有有效凭据的 SMTP 服务器,无论是您自己的还是某些远程服务(即 google mail)。
然后只需输入这些凭据即可完成。
我猜您没有在本地设置 SMTP 服务器,因此出于测试目的,您可以使用 xyz 电子邮件提供商。
不,一旦您找到要在此处输入的凭据,请删除括号。
SMTP is a protocol that SendMail implements.
What you need is an SMTP server for which you have valid credentials, be it your own or some remote service (ie google mail).
Then just enter those credentials and you should be done.
I guess you don't have an SMTP server set up locally, so for testing purposes you can use your xyz Email provider.
And no, remove the brackets once you found out what credentials you want to enter there.