Re: How to send a mail from within a program
Re: How to send a mail from within a program
- Subject: Re: How to send a mail from within a program
- From: Tim Hewett <email@hidden>
- Date: Thu, 10 Jul 2003 09:09:24 +0100
Hello,
I am the original raiser of this thread. Someone has shown me
the undocumented class NSMailDelivery. This method does it
all:
- (IBAction)sendEmailManually:(id)sender
{
NSString *theEmailDest = @"someone@somewhere";
NSString *theSubject = @"Important Message";
NSString *theBody = @"Hello there!";
if ( [NSMailDelivery deliverMessage:theBody subject:theSubject
to:theEmailDest] )
NSLog(@"Email Sent");
else
NSLog(@"Email Not Sent");
}
The only thing to note is that you must be online when sending
the mail, there is no "outbox" queueing as such, but that's ok.
Simple and easy, when you know how.
Thanks for all the suggestions,
Tim Hewett.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.