Re: Emailing from a daemon process
Re: Emailing from a daemon process
- Subject: Re: Emailing from a daemon process
- From: Carl Hoefs <email@hidden>
- Date: Thu, 07 Jul 2016 09:44:26 -0700
> On Jul 7, 2016, at 9:33 AM, Jens Alfke <email@hidden> wrote:
>
>> On Jul 7, 2016, at 9:13 AM, Carl Hoefs <email@hidden <mailto: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.
It's a daemon, started at boot time and runs outside of a user login. Even so, it wouldn't be appropriate to communicate with a GUI app, which still requires user intervention, if only to press the Send button.
>
> 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.)
It seems a bit odd to me that I can connect all sorts of little network devices (webcams, network monitors, remote power switches, etc) to a LAN and they can all be set to issue email. I didn't really want to go 3rd party, as there is a yearly cost to the only package I could find (which is just a dylib, not source).
-Carl
_______________________________________________
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