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

    hi.good site.

使用 RSS 訂閱本文留言回應 · 引用網址

張貼留言