views:

503

answers:

2

In an iPhone app I'm developing, I need to send an email programmatically (read, not allowing the user to see where the email is going) similar to the PHP mail() function. Is there a way to do that?

Thanks in advance.

+1  A: 

There's no way to do this in iPhone OS 3.0 (without jailbreaking, of course). To send email, you must use the MFMailComposeViewController.

Ben Gottlieb
Sigh. I was afraid of that. I guess I'll write my own function. Thanks!
mclaughlinj
I guess as far as the user pays for the connection (and for the iPhone for that matter) and maybe even for your app, they want to know if your app is using their resources and sending something somewhere in the email.
stefanB
A: 

There are some libraries that might help. Take a look http://vafer.org/blog/20080604120118. However, you'll have to provide SMTP details, which is not ideal. As Ben says you can't send a mail from the users account without going through MFMailComposeViewController.

lyonanderson