The most reliable way to deliver email from users email address on rails?

I want to allow users to send emails created in my rails application from their email address.

I know that I can just use my sendmail servers and set the address from the address to my email address, but there is a chance that the messages will be marked as spam.

Is there a better way to do this? Can I use sendgrid or Amazon SES or do input with custom SMTP data.

Any suggestions or best practices would be greatly appreciated.

+7
source share
3 answers

I believe SendGrid supports setting the From address. Heroku provides them as an add-on, and they advertise "Full control of the From: address." on the add-ons page

+5
source

In this case, using Amazon SES is out of the question: an authorization procedure is required before sending as a specific email address.

Even if you requested them for information about the SMTP server, this will lead to sending huge red flags to any competent users. Most SMTP servers are configured to either require authentication during the SMTP transaction, or require a recent POP3 or IMAP connection, which means collecting user credentials. Do you want your users to trust you with their email password?

All in all, this is actually an incredibly bad idea, especially considering email authentication methods such as SPF / Sender ID . Mail messages sent this way through unauthorized servers are increasingly becoming (by right) marked as spam.

Will your use case let emails “off” your application, but have a “response to” the user?

+5
source

This will not work in the face of SPF. SPF is essentially a way for a domain to say that "the email address that should be from this domain will be sent only from these servers," so if you send an email from a user in this domain from your server, any Those performing SPF checks will probably mark your mail as spam.

Essentially: do not use the From header if mail is not sent, use the Sender header instead.

+5
source

All Articles