[MacRuby-devel] Basic delayed email method

Steve Clarke steve at sclarkes.me.uk
Tue Oct 23 00:20:59 PDT 2012


Hi Cliff,

I struggled with this too.  I'm afraid I can't remember all the details, but I think that one key point is that you need to have an "outgoing message" to respond to send.  You may need to add your draft message to the mail apps "outgoing messages" before it can be sent.  Try something like

mail.outgoingMessages.addObject(draft)

Steve

On 23 Oct 2012, at 07:06, Cliff Rosson <cliff.rosson at gmail.com> wrote:

> 
> My drafts folder has 1 message in it ready to be sent.
> 
> mail = SBApplication.applicationWithBundleIdentifier("com.apple.mail")
> my_account = mail.accounts.select { |account| account.name == "MyAccountName" }.first
> drafts_folder = my_account.mailboxes.select { |mailbox| mailbox.name == "Drafts" }.first
> draft = drafts_folder.messages.first
> 
> I need to use the send method somehow. I think I need to make a new MailOutgoingMessage but I would like to make this message based on my already existing draft message.
> 
> Any know how this is done?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20121023/eb7b5e06/attachment.html>


More information about the MacRuby-devel mailing list