Re: NSSharingService and default mail client
Re: NSSharingService and default mail client
- Subject: Re: NSSharingService and default mail client
- From: Martin Hewitson <email@hidden>
- Date: Sun, 02 Jun 2013 18:37:36 +0200
On May 21, 2013, at 04:35 PM, Martin Hewitson <email@hidden> wrote:
>
> On May 21, 2013, at 4:30 PM, Fritz Anderson <email@hidden> wrote:
>
>> [I'd accidentally posted my reply off-list. Bringing it back.]
>>
>> The times I've autogenerated emails, I did so without thinking of alternate clients. On MacOS, I used -[NSWorkspace openURL:], which can be funky for a long or non-ASCII body, but could be made to work. The system should honor the user's choice for mailto: handlers.
>
> OK, I need to read some more about mailto handlers. I dipped my toe in this while trying to figure out how to move away from the my old applescript methods, but I kind of got stuck. I'm assuming one can do attachments in a mailto url?
OK, after reading some about this, it seems that one can't have attachments with a mailto: handler on OS X. Is that correct? If so, I'm back to my original question: how can I robustly send a mail with the user's default mail client and be able to fill in all the details (recipients, subject, body including attachments). And I need this to work on 10.7 and 10.8. Anyone any good ideas? Seems like this should be a solved problem.
Many thanks,
Martin
>
>>
>> But that may be hard to integrate with NSSharingService. Perhaps you could fall back on mailto: in the didFail… delegate method.
>
>
> I've no real desire to use NSSharingService. If I find a way to reliably send a mail (with attachments) then I'll be most delighted.
>
> Cheers,
>
> Martin
>
>>
>> — F
>>
>>
>> On 21 May 2013, at 12:52 AM, Martin Hewitson <email@hidden> wrote:
>>
>>> Hi Fritz,
>>>
>>> I did take a look at the delegate callbacks, and -sharingService:didFailToShareItems:error: is called when the default client is anything other than Mail.app, but the error is 'empty' so presenting it to the user doesn't reveal what's wrong.
>>>
>>> More importantly, this sharing by email doesn't seem to work for any other app I tried when the default mail client is not Mail.app. Seems strange to me. Do you have experience of sharing my mail working for, say, Thunderbird? With any app at all?
>>>
>>> Cheers,
>>>
>>> Martin
>>>
>>>
>>>
>>> On May 20, 2013, at 05:00 PM, Fritz Anderson <email@hidden> wrote:
>>>
>>>> On 19 May 2013, at 8:29 AM, Martin Hewitson <email@hidden> wrote:
>>>>
>>>>> I'm exploring the use of NSSharingService for emailing (sharing) documents from within my app. It's working fine if the system's default mail client is set to Mail.app. But if it's set to, for example, Thunderbird, nothing happens.
>>>>>
>>>>> I also confirmed the same behavior from the Share menu in Pages.app. Works fine for Mail.app, but not for any other mail client I tried. The user is not notified, just nothing happens.
>>>>>
>>>>> Is this a bug or a feature?
>>>>>
>>>>> I really wish there was a solid way to send a mail from within an app on OS X. With the whole sandbox/applescript debacle, I was hoping that NSSharingService would at least work well on 10.8, but, apart from the 'bug' described above, there seems to be no way to set the recipients or subject of the mail.
>>>>
>>>> You've described the user-visble behavior, but not the actual behavior of your code.
>>>>
>>>> Have you registered a delegate and examined the content of -sharingService:willShareItems:, -sharingService:didShareItems:, and -sharingService:didFailToShareItems:error:? Do they get called? With the expected items? If didFail…, what was the error?
>>>>
>>>> — F
>>>>
>>>> --
>>>> Fritz Anderson
>>>> Xcode 4 Unleashed: 4.5 supplement for free!
>>>> http://www.informit.com/store/xcode-4-unleashed-9780672333279
>>>>
>>>
>>>
>>>
>>>
>>>
>>
>> --
>> Fritz Anderson
>> Xcode 4 Unleashed: 4.5 supplement for free!
>> http://www.informit.com/store/xcode-4-unleashed-9780672333279
>>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden