Send mail without MFMailComposeViewController

This is not supported by the iPhone SDK, probably because Apple doesn’t want you to do it.

Why not? My guess: Because it’s easy to abuse. If we knew user’s email address, we could spam them, we could fake emails from them, etc. Imagine finding out an iPhone app sent an email as you without your knowledge — not cool, even if the app had good intentions.

So, anything you do to get around that, is likely to get you rejected from the app store.

Having said all that, you could basically write your own smtp interaction code to chat with the user’s outgoing mail server. For example, if the user has a gmail account, you could ask them for their email and password, you’d have to know how to talk to the gmail servers, and send email through them.

Going that route means asking the user for their username, password, and either asking for or figuring out their mail server information. Another choice is to send directly from the phone (your own smpt server, not just a client), which is a bit more coding. And if you write your own server, the mail you send is more likely to be blocked since your originating IP might not match the domain on the sender’s email.

There also exist some libraries that might help out. Previous related question:

Leave a Comment