Re: How to Pop Up Mail Compose Window
Re: How to Pop Up Mail Compose Window
- Subject: Re: How to Pop Up Mail Compose Window
- From: Henry McGilton <email@hidden>
- Date: Sat, 29 Sep 2001 19:45:46 -0700
On Saturday, September 29, 2001, at 10:57 AM, Eric Peyton wrote:
On Saturday, September 29, 2001, at 12:45 PM, Vince DeMarco wrote:
On Friday, September 28, 2001, at 07:51 pm, Henry McGilton wrote:
Hello All,
in the apps I am developing, I wish to have a Suggestions
capability. The way I envisage this working is that I would
somehow message the Mail app to pop up its Compose window,
and I would send it the contents to fill in the From:, To:,
and Subject: fields, such that the user can simply type in
the body of the message and then push Send.
Back in NextStep days, there was a kind of 'back door' way
of doing this via the NXApp speaker, but I don't see anything
analogous in the App Kit.
Any ideas would be appreciated.
make a url that has the info
mailto:email@hidden
the create a NSURL from it and ask workspace to openURL: I think this
will work, but i haven't tried it myself.
Yes, it works fine, and has the advantage of opening the URL in the
user defined preferred mail application.
Thank You All for the responses. In fact, it got even better. Here is
the code:
NSURL *mailtotrilithon = [NSURL URLWithString:
@"
mailto:email@hidden?subject=Comments And Suggestions For Rulers"
];
[[NSWorkspace sharedWorkspace] openURL: mailtotrilithon];
And so not only do I get the correct To: address, but I also get the
Subject: field
filled in as well.
Best Wishes,
........ Henry