Skip to content

Instantly share code, notes, and snippets.

@gregolsen
Created August 17, 2012 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregolsen/3377065 to your computer and use it in GitHub Desktop.
Save gregolsen/3377065 to your computer and use it in GitHub Desktop.
send numbered emails to mailtrap
require 'net/smtp'
(0..9).each do |i|
message = <<-END.split("\n").map!(&:strip).join("\n")
From: Private Person <me@fromdomain.com>
To: A Test User <test@todomain.com>
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, 'me@fromdomain.com',
'test@todomain.com'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment