On Nov 8, 2010, at 6:44 PM, vishy wrote:

> Hi All,
> 
> I am trying to send an email on a user sign up. The email is working
> without any issues. However there is a problem with the :from field
> that I am specifying. My SMTP setting look like :
> 
> ActionMailer::Base.smtp_settings = {
>  :address              => "smtp.gmail.com",
>  :port                 => "587",
>  :domain               => "test.com",
>  :user_name            => "[email protected]",
>  :password             => "secret",
>  :authentication       => "plain",
>  :enable_starttls_auto => true
> }
> 
> and my mailer class looks like,
> 
> class TestMailer < ActionMailer::Base
> 
>  def registration_confirmation(user)
>    @user = user
>    mail(:to => "#[email protected]_name} <#[email protected]}>", :subject
> => "Welcome", :from => '[email protected]')
>  end
> end
> 
> When the email gets sent, in the console I see that the following :
> 
> Sent mail to [email protected] (2846ms)
> Date: Mon, 08 Nov 2010 20:05:26 -0600
> From: [email protected]
> To: Test <[email protected]>
> Message-ID: <[email protected]>
> Subject: Welcome
> Mime-Version: 1.0
> Content-Type: text/html;
> charset=UTF-8
> Content-Transfer-Encoding: 7bit
> 
> <p>Dear xxxxxxx,</p>
> 
> <p>Welcome </p>
> 
> Everything looks good till here. However when I receive the email, I
> see from email address shows as the "[email protected]" instead of
> [email protected].
> 
> Any pointers as to why that might be happening or how I can fix this
> will be greatly appreciated.

I've never used google to send mail, but maybe they force that on you.  
Technically the message is from [email protected].  Maybe you can set Reply-To: 
[email protected] instead?  That might be enough for your 
purposes...

-philip

-- 
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.

Reply via email to