SendGrid not sending emails on Heroku from default inqury/contact form

发布于 2022-09-06 08:12:32 字数 1615 浏览 37 评论 0

This is my first app using RefineryCMS. The way I have sent mail from applications in the past is not currently work with my refinery app.

I have tried numerous ways of doing this by way of numerous searches on the internet and I cannot make this work.

Currently, here is what I have:

In the environment.rb file I have this:

config.action_mailer.smtp_settings = {
    :enable_starttls_auto => true,
    :address        => 'smtp.sendgrid.net',
    :port           => '25',
    :authentication => :plain,
    :user_name      => 'myusername@mydomain.com',
    :password       => 'mypassword',
    :domain         => 'mydomain'
  }

I have also tried:

ActionMailer::Base.smtp_settings = {
    :enable_starttls_auto => true,
    :address        => 'smtp.sendgrid.net',
    :port           => '25',
    :authentication => :plain,
    :user_name      => 'myusername@mydomain.com',
    :password       => 'mypassword',
    :domain         => 'mydomain'
  }

I have tried putting these settings in the production and development classes. Tried locally and on heroku but I just can't get the built in inquiry/contact form to send out the notifications emails and I have no idea why it won't work.

Like I said earlier, I have tried every solution (they are all very similar) I can find for this but can't make it work. If somebody could please tell what I am doing wrong and what, exactly, it is I need to do, that would be awesome.

Thanks in advance, ~Mike

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

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

发布评论

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

评论(1

林空鹿饮溪 2022-09-13 08:12:32

Actually, it was a bug in the existing version of refinerycms-inquiries that was causing the mail not to send. once I updated to 0.9.9.9, it worked as expected. In case anyone needs to know how to perform this update:

First, add this line to your Gem file:

gem 'refinerycms-inquiries',    '~> 0.9'

Then run this command:

bundle update refinerycms-inquiries

and this is all I added to the environment.rb file:

ActionMailer::Base.smtp_settings = {
    :enable_starttls_auto => true,
    :address        => 'smtp.sendgrid.net',
    :port           => '25',
    :authentication => :plain,
    :user_name      => 'myemail@domain.com',
    :password       => 'mypassword',
    :domain         => 'mydomain.com'
}

That's it.

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