Re: Can NSMailDelivery be configured programmatically?
Re: Can NSMailDelivery be configured programmatically?
- Subject: Re: Can NSMailDelivery be configured programmatically?
- From: Andrew Farmer <email@hidden>
- Date: Sat, 3 Jun 2006 02:00:15 -0700
On 03 Jun 06, at 00:25, Dominic Blais wrote:
On Jun 3, 2006, at 12:16 AM, Derrick Bass wrote:
I have an application that needs to be able to send email
autonomously, but many of the users will not have Mail set up, so
[NSMailDelivery hasDeliveryClassBeenConfigured] will return NO.
In such a case, I'd like to be able to ask users to input their
SMTP settings. Is there a way to programmatically set those
without forcing the user to set up Mail.app itself?
If you simply need them to be able to send mail, you can use the
command line sendmail program; they don't need a SMTP server. This
has been a standard unix way of sending mail for years.
However, it won't always work correctly.
Unless the user's done some configuration, sendmail will just connect
directly to the
destination mail server. This will fail if:
1] The user's ISP or local network blocks outgoing port 25. (A few
big ISPs do this.)
2] The user is on a dynamic IP connection, and the destination uses a
dynamic IP
blacklist for spam prevention. (Most residental users have
dynamic IPs, and a lot
of mail servers use blacklists to block spam zombies.)
3] The user isn't connected to the Internet at the moment. (Entirely
possible.)
The fact is, unfortunately, that there's really no good way to script
the sending of
mail from a Cocoa application. If you're using mail as a method of
"calling home",
you may want to consider setting up a PHP script (or your web
language of choice)
to handle form submissions instead. That'll be a lot easier in the
long run, and
has the distinct advantage of allowing you an instant response, if
necessary.
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden