Created
August 25, 2015 15:54
-
-
Save vampaynani/22e607ec896216e979cd to your computer and use it in GitHub Desktop.
Outlook mailing from Ruby (Only for Windows)
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
require 'win32ole' | |
outlook = WIN32OLE.new('Outlook.Application') | |
message = outlook.CreateItem(0) | |
message.Subject = 'Hola Mundo' | |
message.Body = 'Mail de prueba' | |
message.BCC = '' #Con copia para | |
message.SentOnBehalfOfName = '' #Mandar el correo a nombre de otro | |
message.To = '[email protected]' #Mail de quien recibirá el mensaje | |
#message.Attachments.Add('path/to/file') #En caso de querer adjuntar un archivo | |
message.Save #Si se desea guardar un borrador del mensaje | |
message.Send |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment