Automating Outlook With Ruby: Sending Email
Join the DZone community and get the full member experience.Join For Free
From the Ruby on Windows blog. Here's an example of how to use Win32 OLE/COM automation to create and send an email message with Microsoft Outlook.
require 'win32ole' outlook = CreateObject('Outlook.Application') message = outlook.CreateItem(0) message.Subject = 'Subject line here' message.Body = 'This is the body of your message.' message.To = 'firstname.lastname@example.org' message.Attachments.Add('c:\my_folder\my_file.txt', 1) message.SendFurther details can be found here.
Opinions expressed by DZone contributors are their own.