Re: Emailing from a daemon process
Re: Emailing from a daemon process
- Subject: Re: Emailing from a daemon process
- From: Jens Alfke <email@hidden>
- Date: Thu, 07 Jul 2016 09:33:47 -0700
> On Jul 7, 2016, at 9:13 AM, Carl Hoefs <email@hidden> wrote:
>
> I have a daemon app built on Foundation (aka "command line tool") running in the background and I need it to issue a textual email on certain conditions.
Do you mean daemon or agent? A daemon runs outside of any user login session and is usually started at boot time. An agent has no UI but is part of the login session. This is significant, because an agent process can communicate with GUI apps using AppleEvents or XPC.
There isn’t any easy way of doing this that I know of, if you can’t tell Mail.app to do it. There are built-in Postfix mail tools, but they’re not configured for relaying mail to a server. You’d have to talk to the SMTP server yourself, but that involves reading the user prefs to get the server configuration, and likely finding credentials to log in with… (There might be a 3rd party library for doing this, though.)
—Jens
_______________________________________________
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