i believe gmail rewrites the from address to help prevent spam. you
can test this using outlook, thunderbird, etc.
i think they want you to set the reply to address.
On Sep 16, 7:38 am, Vipin Vm <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Am trying to send email through gmail in rails. Its working fine. My
> issue is @from is not working. I have assigned @from = '[EMAIL PROTECTED]'
> in my emailer.rb and :user_name => "[EMAIL PROTECTED]" in my
> environment.rb file. When i receive mail, from id is "[EMAIL PROTECTED]"
> not "[EMAIL PROTECTED]". 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 PROTECTED]'
> @subject = subject
> @recipients = email
> @sent_on = sent_at
> @body["name"] = name
> @body["message"] = message
> end
> end
>
> ActionMailer::Base.delivery_method = :smtp
> require 'smtp_tls'
>
> ActionMailer::Base.smtp_settings = {
> :address => "smtp.gmail.com",
> :port => 587,
> :domain => "www.google.com",
> :user_name => "[EMAIL PROTECTED]",
> :password => "mypassword",
> :authentication => :plain
>
> }
>
> Thanks in advance :)
>
> Vipin
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---