DEV Community

Discussion on: Sending Emails in Rails with Action Mailer and Gmail

Collapse
 
gnmithun profile image
Mithun Nair • Edited

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?