1

I have read that In App SMS is finally supported in iPhone OS 4...look at here

I want to know that if it is also possible to send emails automatically without user's intraction if yes then how?.I mean while our application is running.

Community
  • 1
  • 1
Kumar sonu
  • 535
  • 11
  • 24

2 Answers2

2

No, that's not possible with the official iPhone SDK.

You have to use MFMailComposeViewController or [[UIApplication sharedApplication] openURL: @"sms:12345678"]; or send a text.

Henrik P. Hessel
  • 36,243
  • 17
  • 80
  • 100
  • 1
    yes, you cannot send both sms and email without user interaction. – Henrik P. Hessel Dec 28 '10 at 14:20
  • You could always sign up for an email service provider that has a JSON API and send HTTP POST requests to it on the back end to programmatically send emails. However, if you're not using this for transactional mails, you probably shouldn't do this without the user's permission. – JonLim Aug 10 '11 at 15:15
0

Here is the code for Email

NSString *recipients=[NSString stringWithFormat:@"mailto:ABC@gmail.com?cc=bcd@gmail.com&subject=Hi"]; NSString *body=[NSString stringWithFormat:@"&body=How r u "];

        NSString *email=[NSString stringWithFormat:@"%@%@",recipients,body];
        email=[email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
Naren
  • 115
  • 2
  • 14