Created
August 17, 2012 08:37
-
-
Save gregolsen/3377065 to your computer and use it in GitHub Desktop.
send numbered emails to mailtrap
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
require 'net/smtp' | |
(0..9).each do |i| | |
message = <<-END.split("\n").map!(&:strip).join("\n") | |
From: Private Person <[email protected]> | |
To: A Test User <[email protected]> | |
Subject: #{i} message | |
This is a test e-mail message. | |
END | |
Net::SMTP.start('localhost', | |
2525, | |
'localhost', | |
'erhqa', 'eae1d9f3ec043840', :plain) do |smtp| | |
smtp.send_message message, '[email protected]', | |
'[email protected]' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment