Forum: Ruby on Rails ActionMailer problem

Ce47044a11f24447e118f412b01b992f?d=identicon&s=25 Maddy (Guest)
on 2012-08-09 13:07
(Received via mailing list)
Hi guys!

I used action mailer in my project,in that the from ID show always my
own
ID.I need it show some default ID like.,from@gmail.com

Here my coding,

In my set_mailer.rb

ActionMailer::Base.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => "gmail.com",
  :user_name            => "My_personal_ID",
  :password             => "********",
  :authentication       => "plain",
  :enable_starttls_auto => true
}

Here my mailer code:

class EmployeeMailer < ActionMailer::Base
  default from: "from@shriramits.com"
  def employee_creation(user)
    @employee=user
    attachments["logo.png"] =
File.read("#{Rails.root}/app/assets/images/logo.png")
    mail(:to => user.eamil, :subject => "Registered")
  end
end

Please give the solution...!!
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2012-08-09 16:18
(Received via mailing list)
On Aug 8, 2012, at 9:57 AM, Maddy wrote:

>   :port                 => 587,
>   default from: "from@shriramits.com"
>   def employee_creation(user)
>     @employee=user
>     attachments["logo.png"] =
File.read("#{Rails.root}/app/assets/images/logo.png")
>     mail(:to => user.eamil, :subject => "Registered")
>   end
> end
>
> Please give the solution!

Read this page: http://guides.rubyonrails.org/action_mailer_basics.html

Walter

> !
>
Ce47044a11f24447e118f412b01b992f?d=identicon&s=25 Ashokkumar Yuvarajan (Guest)
on 2012-08-10 07:10
(Received via mailing list)
Thank you  Walter..

On Thu, Aug 9, 2012 at 7:47 PM, Walter Lee Davis <waltd@wdstudio.com>
wrote:

> > In my set_mailer.rb
> >
> > end
> > --
>
> --
> 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 rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


--

*"Attitude is a little thing that makes a big difference"*


Thanks & Regards
*Ashokkumar.Y*
*ROR-Developer
**email : ashokkumar@shriramits.com*


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