-
-
Save Epictetus/1405147 to your computer and use it in GitHub Desktop.
pony_sample. A good wrapper of Net/SNMP + TMail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ponyを使ってgmail経由でメールを送信 | |
#pony : http://github.com/benprew/pony | |
#メールクライアントの設定-GMailヘルプ : http://mail.google.com/support/bin/answer.py?hl=jp&answer=13287 | |
require 'rubygems' | |
require 'pony' | |
Pony.mail(:to => '[email protected]', | |
:body => "あああああああああああ", #bodyもsubjectも日本語OK(windows/cygwin) | |
:subject => "テストとととととt", | |
:via => :smtp, | |
:smtp => { | |
:tls => true, #TLSを使う | |
:host => 'smtp.gmail.com', | |
:port => '587', #googleは465または587といっていたが465だとタイムアウトになる。 | |
:user => 'XXX', | |
:password => 'PASSPASSS', | |
:auth => :plain, # gmailでは:plainでないとダメ | |
:domain => "gmail.com" # smtp.gmail.comでもOK | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment