Question

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?

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top