質問

i am using the ActionMailer to send emails and internal SMTP does not require authentication. so my code is very simple:

ActionMailer::Base.mail(
  :from => 'example@...',
  :to   => 'example@...',
  ...
);

but it doesn't actually send emails. do i miss something?

役に立ちましたか?

解決

You have to call 'deliver' on the mail.

ActionMailer::Base.mail(:from => 'sender@example.com', 
                        :to => 'receiver@example.com', 
                        :subject => 'An Email Subject', 
                        :body => 'Thank you for reading').deliver
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top