以下の内容はhttps://takuya-1st.hatenablog.jp/entry/2014/07/27/171846より取得しました。


Rubyでメール送信の例

ruby でメール送信です。

一番シンプルなメール送信の例。STMPサーバーはlocalhost ポートは25

#!/usr/bin/env ruby
#coding:utf-8

require 'mail'

options = { 
  :address  => "localhost",
  :port   => 25,
  :authentication => 'plain',
  :enable_starttls_auto => true  
}


Mail.defaults do
  delivery_method :smtp, options
end

mail = Mail.new do
  from     'form-address@localhost'
  to       'user@localhost'
  subject  "mail test"
  body      "this is test mail "
end

mail.deliver!

簡単ですね。いまはmail gem が一番いいんじゃないかと思います。

gem install mail



以上の内容はhttps://takuya-1st.hatenablog.jp/entry/2014/07/27/171846より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14