rubyã§GMailéä¿¡
subversionã®commitããã¿ã¤ãã³ã°ã§ã¡ã¼ã«éä¿¡ãããã¨ã«ãªããGMailã使ã£ã¦ãããªããã¨ã«ãã¾ããã
subversionã®ããã¯ã¹ã¯ãªããã¯è¨èªãªãã§ãããããªãã§ãã²ã¨ã¾ãrubyã§GMailéä¿¡ããæ¹æ³ã確èªã
tlsmailã使ãæ¹æ³ã¨mechanizeã使ãæ¹æ³ã®ãµãã¤ãããã¿ããã
åè
ã¯SMTPéä¿¡ãç´æ¥ä½¿ãæ¹æ³ã
å¾è
ã¯Webãµã¤ã解æã§ä½¿ããã¤ã§ãèªè¨¼ã¨ããéããã
æå
ã®windowsãã·ã³ã§tlsmailåãã®ã確èªãã²ã¨ã¾ãããã§ãããã¨æãã
require "rubygems" require "tlsmail" require "time" arr = Array.new arr << 'From: xxxxx@yyyyy' arr << 'To: xxxxx@yyyyy' arr << 'Subject: TEST' arr << 'Date: #{Time.now.rfc2822}' arr << 'TEST CONTENT' arr << '' arr << 'EOF' msg = arr.join("\r\n") Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) Net::SMTP.start("smtp.gmail.com", "587", "localhost", "account", "password", :plain) do |smtp| smtp.send_message msg, "xxxxx@yyyyy", "zzzzz@yyyyy" end