Forum: Ruby on Rails Rails 3 Action Mailer issue

4ee5ca38cb149788ca612902d857212e?d=identicon&s=25 vishy (Guest)
on 2010-11-09 03:45
(Received via mailing list)
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            => "support@test.com",
  :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 => "#{@user.capitalized_name} <#{@user.email}>", :subject
=> "Welcome", :from => 'registration-do-not-reply@test.com')
  end
end

When the email gets sent, in the console I see that the following :

Sent mail to xxxxxxx@hotmail.com (2846ms)
Date: Mon, 08 Nov 2010 20:05:26 -0600
From: registration-do-not-reply@test.com
To: Test <xxxxxxx@hotmail.com>
Message-ID: <xxxxx@test.local.mail>
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 "support@test.com" instead of
registration-do-not-reply@test.com.

Any pointers as to why that might be happening or how I can fix this
will be greatly appreciated.

Thanks,
Vishy
79b35cbe5ea8aa40f6b26f19e6918180?d=identicon&s=25 Mani Siva (manivannansiva)
on 2010-11-09 09:47
(Received via mailing list)
hi vishy!
           It seems that u want ur form email id as '
registration-do-not-reply@test.com' . For that u have give this email id
in
smtp settings.. That is user_name has to be set as the following
email_id..
I think it will work.. Please try it..
2505b282d57c29be797dc35b245adb4c?d=identicon&s=25 Philip Hallstrom (Guest)
on 2010-11-09 15:13
(Received via mailing list)
On Nov 8, 2010, at 6:44 PM, vishy wrote:

>  :user_name            => "support@test.com",
>    @user = user
> To: Test <xxxxxxx@hotmail.com>
>
> Everything looks good till here. However when I receive the email, I
> see from email address shows as the "support@test.com" instead of
> registration-do-not-reply@test.com.
>
> 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 support@test.com.  Maybe you can set
Reply-To: registration-do-not-reply@test.com instead?  That might be
enough for your purposes...

-philip
34efd74ed7319505ddd8c57bdf648e2a?d=identicon&s=25 Vanita Sa (vanitah)
on 2010-12-08 21:01
Hi,

I have the same SMTP settings. I'm just sending emails to myself to test
out. I do the see the sent mail in the console. But I don't receive any
email.

The SMTP settings was working with Rails 2.3.8.

Any ideas?

Thanks!
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.