Rails 求问 Action Mailer 发不出邮件

TheLover_Z · 2013年07月25日 · 最后由 RanX12 回复于 2019年11月14日 · 4861 次阅读

跟着 http://guides.rubyonrails.org/v3.2.13/action_mailer_basics.html 做的,从一开始做到了 2.1.4

然后看到了「Sending out an email should only take a fraction of a second」这时候应该是发出去了,可是收件人并没有收到……

包括 http://guides.rubyonrails.org/action_mailer_basics.html 这里的也跟着做了,还是没有反应。

控制台输出如下:

Sent mail to xxx (343ms) Date: Thu, 25 Jul 2013 17:54:13 +0800 From: [email protected] To: xxx Message-ID: <[email protected]> Subject: Welcome to My Awesome Site Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Welcome to example.com, 1

You have successfully signed up to example.com, your username is: 1.

To login to the site, just follow this link: http://example.com/login.

Thanks for joining and have a great day! Redirected to http://127.0.0.1:3000/users/1 Completed 302 Found in 1317ms (ActiveRecord: 81.0ms)

#1 楼 @Martin91 这个配置过了…没贴代码是因为全都是按照教程来的……2.1.4 之前的都做过了,然后第五节配置这一部分的也做过了

#2 楼 @TheLover_Z 检查一下网络连接,或者有没有可能发过来了,但是被归为垃圾邮件了?我之前遇到过的情况是用 Gmail 发了太多没有真实收件箱的邮件,Gmail 认为我的账号被盗,就不给发了。还有一次是没有任何报错,也是服务器 log 里边可以看到邮件正常发出去了,可是都收不到。后来试着安装了sendmail,就又正常了,可是照理说sendmail应该是不必要的,估计只是巧合。

#3 楼 @Martin91 嗯谢啦~我尝试下~

可能被当垃圾邮件屏避了。不知道你用什么邮箱来收,你相应的查找下如何查找屏蔽邮件。

@Martin91 +1 我用 163 发 gmail 能发出去,能收到 用 gmail 发 163 就发不出去。。

#6 楼 @kai1248 那应该就是 gmail 的问题了吧,你有在网页上尝试登录 gmail 吗?看看登录过程中或者登录进去之后有没有警告信息之类的。

匿名 #8 2013年07月26日

config 下面的环境配置问题吧

求问关于这个 action mailer 应该怎么调试呢?像我在顶楼写的那个日志,有没有更详细的记录?

现在报错信息是:Net::SMTPFatalError (553 Mail from must equal authorized user ): 了。。可是用户名密码没有错应该是什么问题呢?用的是 gmail

感谢各位,感谢 Google,已经弄好了……

#11 楼 @TheLover_Z 请教下你的 Net::SMTPFatalError (553 Mail from must equal authorized user ) 错误是怎么解决的呢?

#12 楼 @mydearxym 时间太久了…我只记得我有这么一篇 blog 记录了最终可用的配置…http://theloverz.me/note/2013/10/02/actionmailer-config-in-rails/ 你看看有没有帮助…

控制台输出这些是。。。[ActiveJob] [ActionMailer::MailDeliveryJob] [1871d1ba-ebe1-4880-b71e-8bb752c44371] Performing ActionMailer::MailDeliveryJob (Job ID: 1871d1ba-ebe1-4880-b71e-8bb752c44371) from Async(mailers) enqueued at 2019-11-14T10:55:38Z with arguments: "UserMailer", "account_activation", "deliver_now!", {:args=>[#>]}

需要 登录 后方可回复, 如果你还没有账号请 注册新账号