08
Nov
11

gmail via ruby



require "net/smtp"

msg = "Subject:test\n\nJust a test"
smtp = Net::SMTP.new("smtp.gmail.com",587)
smtp.enable_starttls
smtp.start("smtp.gmail.com","your_username","your_password",:login) do
  smtp.send_message(msg,"from_address","to_address")
end

Advertisements

0 Responses to “gmail via ruby”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 223,848 hits

%d bloggers like this: