<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'Sending Apple Mail with Ruby and rb-appscript instead of Applescript'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Fri, 24 May 2013 07:26:46 GMT</pubDate>
<item>
<title>mohamed_3d said on 10/22/10</title>
<link>http://snipplr.com/view/2377/sending-apple-mail-with-ruby-and-rbappscript-instead-of-applescript/</link>
<description><![CDATA[ 1.require "appscript"2.include Appscript3. 4.def send_email(subject, content, *addresses)5.  mail = app('Mail')6. 7.  msg = mail.outgoing_messages.end.make(:new => :outgoing_message)8. 9.  # mail.set(msg.visible, :to => true)  # by default, 10.  mail.set(msg.subject, :to => subject)11.  mail.set(msg.content, :to => content)12.  # mail.set(msg.sender, :to => "sender@domain.com")  # otherwise default email address used13. 14.  addresses.each do |addr|15.    msg.to_recipients.end.make(:new => :to_recipient, :with_properties => {:address => addr})16.  end17. 18.  msg.send_  19.end20. 21.# send_email("subject goes here", "Hello Cruel ]]></description>
<pubDate>Fri, 22 Oct 2010 09:26:42 GMT</pubDate>
<guid>http://snipplr.com/view/2377/sending-apple-mail-with-ruby-and-rbappscript-instead-of-applescript/</guid>
</item>
</channel>
</rss>