我应该使用什么库来通过 ruby​​ 发送电子邮件

发布于 2024-11-14 07:12:36 字数 138 浏览 3 评论 0原文

现在我想编写一个应用程序,每天通过 ruby​​ 发送数百万封电子邮件,现在我知道有一些选项,例如 net::smtp 和 actionmailer,也许还有其他选项,有人可以推荐一个更好的库,以便我可以使用它来完成我的工作吗?任务。

先感谢您。

Now i want to write one app which send emails millions each day by ruby, now i know there is some options such as net::smtp and actionmailer, maybe others, could someone recommend one better library so that i can use it to finish my task.

Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

过期以后 2024-11-21 07:12:36

我建议使用 mail gem。 Rails 3 中的 ActionMailer 在底层使用它,它可以与 1.9.2 和 jruby 一起使用,并且这里有大量很好的文档: https://github.com/mikel/mail

代码示例:

Mail.deliver do
   from     '[email protected]'
   to       '[email protected]'
   subject  'Here is the image you wanted'
   body     File.read('body.txt')
   add_file '/full/path/to/somefile.png'
end

您可能还需要考虑使用 Sendgrid 或 Amazon SES 为您发送电子邮件,他们已准备好所有基础设施并确保卓越的交付能力。

I would suggest using the mail gem. ActionMailer in rails 3 uses it under the hood and it works with 1.9.2 and jruby and there is loads of good documentation here: https://github.com/mikel/mail

Code example:

Mail.deliver do
   from     '[email protected]'
   to       '[email protected]'
   subject  'Here is the image you wanted'
   body     File.read('body.txt')
   add_file '/full/path/to/somefile.png'
end

Something else you might want to consider is using Sendgrid or Amazon SES to send email for you, they have all of the infrastructure already in place and ensure excellent deliverability.

離殇 2024-11-21 07:12:36

有很多方法可以做到这一点。

使用 smtp :链接

如果您使用的是 Rails :链接

如果你想使用 gems : 小马

There are many ways to do it.

Using smtp : link

If you are using Rails : link

If you want to use gems : pony

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文