Is it possible to send email in iOS without relying on the default mail / messaging interface of the system? Does it really the same with messaging where you can not create your custom interface for message but to use the default interface of MFMessageComposerViewController?
Asked
Active
Viewed 4,942 times
3 Answers
2
Take a look at this answer.
Locking the Fields in MFMailComposeViewController
If you follow the instructions you can create your own custom View then send email. Without having to use the default MFMessageCompserViewController .
-
2Should note that this bypasses/duplicates all the mail support in the OS including accounts, sending mail while offline/the app isn't running, etc. – smparkes Jan 26 '12 at 01:00
-
thanks Louie.. actually i am just a newbie in iOS, I had to track a lot of code from this.. hehe :D – Aldee Jan 26 '12 at 01:37
-
anything new on this as for iOS9? – Hugo Alonso Jun 30 '16 at 17:24
0
SendGrid library allows user to send email from an ios app without MFMailComposer https://sendgrid.com/blog/send-email-in-ios-with-new-sendgrid-library/
Here’s the basic code for how you can send email with iOS:
//create Email Object
sendgrid *msg = [sendgrid user:@"ApiUser" andPass:@"ApiKey"];
//set parameters
msg.subject = @"email subject";
msg.tolist = @[@"foo@bar.com", @"foo2@bar.com"];
msg.from = @"originalfoo@bar.com";
msg.text = @"hello world";
msg.html = @"<html><body><h1>hello world</h1></body></html>";
//adding unique arguments (Optional)
NSDictionary *uarg = @{@"customerAccountNumber":@"55555",
@"activationAttempt": @"1"};
[msg addCustomHeader:uarg withKey:@"unique_args"];
//adding categories (Optional)
NSString *replyto = @"billing_notifications";
[msg addCustomHeader:replyto withKey:@"category"];
//Image attachment (Optional)
[msg attachImage:self.photo];
//Send email through Web API Transport
[msg sendWithWeb];

ayon.gupta
- 178
- 7
0
If you want to use the email account setup for the device, you'll need to use MFMessageComposerViewController
or a mailto:
url to open Mail.app.

smparkes
- 13,807
- 4
- 36
- 61
-
thanks smparkes.. hmmmm.. does the body of mail have no limitation in mailto: method? – Aldee Jan 26 '12 at 01:57