Skip to content

Instantly share code, notes, and snippets.

@modsaid
Created October 4, 2012 11:45
Show Gist options
  • Save modsaid/3833121 to your computer and use it in GitHub Desktop.
Save modsaid/3833121 to your computer and use it in GitHub Desktop.
Testing ActionMailer from Rails 3 console
#place this directly in the rails console of ur rails application
class UserMailer < ActionMailer::Base
default from: 'sender@espace.com.eg'
def test_email
@receiver_email = 'mahmoud.said@espace.com.eg'
mail(to: @receiver_email, subject: 'testing email from console')
end
end
UserMailer.test_email.deliver!
# If the configuration is correct and everything is fine, the receiver should receive the test email instantly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment