class SupportMailer < ActionMailer::Base default :from => " email1@gmail.com " def welcome_email(ticket) case ticket.game when "gameone" @ticket = ticket headers["Reply-to"] = "email1+#{ticket.token}@gmail.com" headers["Return-Path"] = "email1+#{ticket.token}@gmail.com" mail(:from => " email1@gmail.com ", :to => ticket.email, :subject => "Welcome to 1 Support Ticket") when "gametwo" @ticket = ticket headers["Reply-to"] = "email2+#{ticket.token}@gmail.com" headers["Return-Path"] = "email2+#{ticket.token}@gmail.com" mail(:from => " email2@gmail.com ", :to => ticket.email, :subject => "Welcome to 2 Support Ticket") when "gamethree" @ticket = ticket headers["Reply-to"] = "email3+#{ticket.token}@gmail.com" header["Return-Path"] = "email3+#{ticket.token}@gmail.com" mail(:from => " email3@gmail.com ", :to => ticket.email, :subject => "Welcome to 3 Support Ticket") end end end
I set my default value: from, so I don’t understand why I keep receiving this message, I also try to set it via headers to no avail.
here are my settings
ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "gmail.com", :user_name => " emailx@gmail.com ", :password => "password", :authentication => "plain", :enable_starttls_auto => true }
I just call it that, SupportMailer.support_response(@message).deliver
How to fix it?
source share