Created
January 13, 2011 14:32
-
-
Save spiegela/777939 to your computer and use it in GitHub Desktop.
Mail Enhancement Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smtp = Net::SMTP.start('127.0.0.1', 25) | |
Mail.defaults do | |
delivery_method :smtp_connection, :connection => smtp | |
end | |
mail1 = Mail.deliver do | |
from '[email protected]' | |
to '[email protected], [email protected]' | |
subject 'invalid RFC2822' | |
end | |
mail2 = Mail.deliver do | |
from '[email protected]' | |
to '[email protected]' | |
subject 'invalid RFC2822' | |
end | |
[mail1, mail2].each{ |m| m.deliver! } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mail.defaults do | |
delivery_method :smtp, :return_response => true | |
end | |
mail1 = Mail.deliver do | |
from '[email protected]' | |
to '[email protected], [email protected]' | |
subject 'invalid RFC2822' | |
end | |
mail1.deliver!1 | |
=> #<Net::SMTP::Response:0x10350eac0 @string="250 2.0.0 Ok\n", @status="250"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment