In this post, I will be setting up a mailer in Rails that will send out an email to the website owner when a customer submits an order. (I was usin...
For further actions, you may consider blocking this person and/or reporting abuse
Just so helpful and clear - thanks very much for putting this together and sharing it
Thanks! This article is a little old but hopefully it still works in newer Rails versions :)
thank you for writing this detailed tutorial.
I just wanted to thank you for writing out this detailed tutorial. I'm going through the Rails Tutorial (which uses SendGrid) but was able to get everything working with Gmail thanks to your instructions. It was kind of hard finding recent, still-accurate information!
If this is not done, google will block you and mail won't be delivered. You may get
Net::SMTPAuthenticationError: 535-5.7.8 Username and Password not accepted
errorAlso google may block you.
Honestly, I ended up running into problems even after allowing "Less secure app access" (it just stopped sending emails) so I definitely recommend using the two-factor authentication!
Felice -
This is such a nice post. Thanks for taking the time to break things down like you did. I'd never built a mailer in Rails, but following your post I was able to with no problems at all.
Keep up the great work!
Rather than "allowing less secure apps" in gmail you can create a specific app password: support.google.com/accounts/answer...
Thanks man! That helped me to make it work!
Thanks a lot, the 2-step method really helped!
*just need to restart the server for it to actually work (rails s)
Hi there,
Thank you very much for the great tutorial.
On Docker in dev mode I had this error:
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 peeraddr=172.253.122.108:587 state=error: certificate verify failed (self signed certificate in certificate chain))
To fix it I added to
config.action_mailer.smtp_settings
::enable_starttls_auto => true
Maybe it will help out someone
Cheers
Hi, I'm following this article to setup mailer, and get the following error ==>
Template is missing
Missing template event_mailer/new_event_request_email with "mailer". Searched in: * "event_mailer"
would you be able taking a look on it ? Do u have any idea why I'm getting this error ?
This was very helpful @morinoko! Thank you so much for writing this article.
Thanks for your comment, Michael! I'm glad the article helped :D
I'm having a issue with my action mailer functionalities, it works fine with open letter gem but with smtp config token only run on my terminal it won’t deliver to mail, 421 server too busy error.
stackoverflow.com/questions/737354...
Thank you bro!!!, you saved me in a part of my project. We were with my colleagues stuck in this part. Very good article. You are awesome!
Hi Felice, This is a great tutorial and it help me setup and use Action Mailer. Thank you. One question.
When I used Gmails SMTP server i.e "smtp.gmail.com", everything worked fine for me. But when I tried using a different SMTP server i.e a service called sendinblue.com/ whose SMTP server is "smtp-relay.sendinblue.com", the SMTP server returns a 501 which essentially means sender address syntax is bad. After some investigation I discovered that the reason was the sender address should be in "<>" . Oddly enough, in another part of my app where I use Devise Gem, the mail confirmation for registering a new user works fine with this SMTP server and without the <>. So the SMTP configuration and mailer is perfectly fine. Its only when I explicitly call the Action Mailer with this particular SMTP server that it fails. As I mentioned above, the mailer works fine with Gmail SMTP server also.
Any thoughts on this?
Thanks for sharing this.
Worked great; just what I needed; thank you!
Thanks for this wonderful article
Thank you very much :D! helped me a lot!
Thanks @morinoko for this article, it was thoroughly explained, and it still works in July 2021!
I used 2-step verification + app password method and it worked on the first try ;)
Great! I'm glad it helped (and still works) ;)
THANK YOU for this. I was beating my head against a wall all morning trying to solve this. So glad for DEV...
Awesome, glad this is still relevant and helped you figure our your issue!
Oh man thank you so much for this! I was having some real trouble figuring this out and you really cover all the bases. Thanks a ton!!!