Am trying to send email through gmail in rails. Its working fine. My
issue is @from is not working. I have assigned @from = 'email@example.com'
in my emailer.rb and :user_name => "firstname.lastname@example.org" in my
environment.rb file. When i receive mail, from id is "email@example.com"
not "firstname.lastname@example.org". When its not gmail and port is 25 its works fine.
class Emailer < ActionMailer::Base
def sendmail(subject, email, sent_at, name, message)
@from = 'email@example.com'
@subject = subject
@recipients = email
@sent_on = sent_at
@body["name"] = name
@body["message"] = message
ActionMailer::Base.delivery_method = :smtp
Thanks in advance