[NEWBIE] How to send an email with Cocoa?
[NEWBIE] How to send an email with Cocoa?
- Subject: [NEWBIE] How to send an email with Cocoa?
- From: Igor Couto <email@hidden>
- Date: Thu, 28 Oct 2004 10:36:44 +1000
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