Email sending in OSX App?

Hi,

perhaps anybody can me help.

I want send an email out of my OS X application. I find the two solutions:

1)

NSURL * url;

url = [NSURL URLWithString:@"mailto:support@raschesspiele.de"

"?subject=Hello%20Cruel%20World!"

"&body=Share%20and%20Enjoy"

];

assert(url != nil);

(void) [[NSWorkspace sharedWorkspace] openURL:url];


2) or with the NSSharingService


Both solutions start mail.app and I see the my email in a window. Fine.

I don`t see this email.

I want: my email should send automatic away.

How can I do this?

Thanks

Uwe

You cannot do that. Opening a URL will always activate an app. If you want to automatically send mail, you could consider using AppleScript. Although that will actually show the compose window to the user as it is being sent (I haven't used the AppleScript approach in a while so it may have changed in recent releases).

Email sending in OSX App?
 
 
Q