Re: [NEWBIE] How to send an email with Cocoa?
Re: [NEWBIE] How to send an email with Cocoa?
- Subject: Re: [NEWBIE] How to send an email with Cocoa?
- From: Jeff Ganyard <email@hidden>
- Date: Mon, 1 Nov 2004 11:00:30 -0800
You would have a lot fewer headaches if you would rethink this and do
your registration submission via http. I have yet to hear of port 80 be
blocked by any corporate firewall. You do not have to know anything
about SMTP hosts or auth strategies or email clients or attachments.
Just send a post request with you data. If you add in a tiny bit of
WebKit you can even very easily display the results from your
webserver.
Of course, this will require having to figure out a smattering of some
server side scripting/cgi language to process the post request but
that's going be essentially trivial compared to all the variant cases
you will run into trying to use email.
Apple even covered the topic nicely:
<http://developer.apple.com/internet/webservices/webkitreg.html>
hope this helps (it really is a much easier route)
jeff
On Oct 27, 2004, at 5:36 PM, Igor Couto wrote:
To all list members who replied to this thread:
Many Thanks for all your suggestions!
My original posting stated the following:
I am writing a software registration module. The module will collect
registration info from the user, encrypt it, and then produce a file
with the encrypted information. I would like to be able to email the
file (to a default registration email box) from inside my Cocoa app.
Rather than having to deal with network protocols, worrying about
connection states, firewalls, etc., I thought it would be easier to
simply try to get the user's default email client to send the message
for me. I do not mind whether the user has to click the 'send' button
inside their email client or not.
I know - from responses received earlier - that I can use
NSWorkspace's "-openURL:" method, passing it a URL with an extended
mailto scheme - which may include subject and body. I've tried that,
and it works. The only problem that remains, though, is: HOW DO I
ATTACH THE REGISTRATION FILE TO THE MESSAGE?
Some have suggested that I use the 'Message' framework. But as far as
I understand - and please, do correct me if I'm wrong - that framework
can present 2 problems. First, it seems to rely on the user having
configured their Mail app. Unless the user has entered their mailing
information correctly - for Mail - during system setup, the framework
will not function correctly. Secondly, it does not use the user's
default email client, but rather, tries to send the message directly -
which may cause problems where users are inside tightly firewalled
networks. That was my reasoning for wanting to use the user's default
emailer in the first place.
So, any hints or suggestions on how to get this to work would be
IMMENSELY appreciated! :-)
Now, one little 'slap on the wrist':
I would like to point out that my original message was NOT SENT TO
THIS MAILING LIST. Until 5 minutes ago, I was not even a member of
this list. My original message was posted to another mailing list
hosted at apple: 'email@hidden'.
It seems that one of you participates on both lists, and does not
bother to check which list the emails are coming from. You sent your
reply to the wrong list, which prompted an entire thread to be created
here. While the responses you received were great, they would have
been of no use to me - the original poster - because I did not even
know they existed. I found out these replies *by accident*, while
doing a search on "http://www.cocoabuilder.com".
Please, do not be lazy with your email. You can quickly setup a
RULE/FILTER in your email client, which will automatically archive
messages from different lists in different folders. And, above all:
make sure that when you address your message, you are sending it to
the *right* list!
Cheers,
--
Igor Couto
Sydney, Australia
_______________________________________________
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
_______________________________________________
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