I'm developing an internal operations manager for a company, They need to send automatic emails to their costumers, but the email has to be sent by the email address of the company operator that is taking care of that specific costumer.
So basically, I need to configure my mailer to work with N different emails (I have access to their emails passwords too).
config.action_mailer.smtp_settings = {
:address => 'smtp.office365.com',
:port => '587',
:authentication => :login,
:user_name => ENV['SMTP_USERNAME'],
:password => ENV['SMTP_PASSWORD'],
:domain => 'interworldfreight.com',
:enable_starttls_auto => true
}
I've seen that it is possible to send the email address to the mailer config this way:
def new_mail
mail from: "example@example.com", to: "user@example.com"
end
But what about the password?, is this even possible through only rails or should I consider other tool like MailGun ?
Thanks a lot for taking a moment to read this.