Skip to content

Instantly share code, notes, and snippets.

@vmi
Created September 15, 2016 08:30
Show Gist options
  • Save vmi/2f3d340e9776519ee6e2a0da5229f7b8 to your computer and use it in GitHub Desktop.
Save vmi/2f3d340e9776519ee6e2a0da5229f7b8 to your computer and use it in GitHub Desktop.
Outlookメール作成覚え書き
require 'win32ole'
# 参考
# - Using Automation to Send a Microsoft Outlook Message
# https://support.microsoft.com/en-us/kb/161088
# - Office の開発 > Office クライアント > Outlook
# https://msdn.microsoft.com/ja-jp/library/office/fp161224.aspx
outlook = WIN32OLE.connect("Outlook.Application")
mail = outlook.CreateItem(0)
mail.Subject = "サブジェクト"
mail.To = "送信先" # 複数のアドレスに送信したい場合は Recipients を操作する
mail.Body = "本文" # 改行は "\r\n"
mail.Display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment