Simple ruby send mail example.

require ‘net/smtp’
msg = <<END_OF_MESSAGE

From: from_alias <from_where>
To: to_alias <to_where>
Subject: Ruby Mail Test

As title. This is a test mail sending by ruby.

END_OF_MESSAGE

Net::SMTP.start() do |smtp|
smtp.sendmail( msg, “from_where", “to_where" )
end

That’s all.:D

Reference Link:
sendmail (Net::SMTP)

1 則迴響 »

  1. billy said

    hi.good site.

RSS feed for comments on this post · TrackBack URI

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

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

Twitter picture

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

Facebook照片

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

Google+ photo

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

連結到 %s

%d 位部落客按了讚: