Send email in ios, send email in ios background

Source: Internet
Author: User

Send email in ios, send email in ios background
Send email in ios

By Wu xueying


First:

NSString *myEmail = @"3423423423@qq.com";NSString *toemail = @"asdfasdf@gmail.com";NSString *emailDetail = [NSString stringWithFormat:@"mailto:%@?cc=%@&subject=Feedback!&body=Dear:",toemail,myEmail];[[UIApplication sharedApplication] openURL: [NSURL URLWithString: emailDetail]];

Second:

- (void)displayMailPicker {    MFMailComposeViewController *mailPicker = [[MFMailComposeViewController alloc] init];    mailPicker.mailComposeDelegate = self;    [mailPicker setSubject: @"Feedback!"];    NSArray *toRecipients = [NSArray arrayWithObject: @"3434234@qq.com"];    [mailPicker setToRecipients: toRecipients];    NSArray *ccRecipients = [NSArray arrayWithObjects:@"asdfa@gmail.com", nil];    [mailPicker setCcRecipients:ccRecipients];        // add a picture    UIImage *addPic = [UIImage imageNamed: @"icon_logo@2x.png"];    NSData *imageData = UIImagePNGRepresentation(addPic);    [mailPicker addAttachmentData: imageData mimeType: @"" fileName: @"Icon.png"];        NSString *emailBody = @"<font size='4'>Dear:</font>";    [mailPicker setMessageBody:emailBody isHTML:YES];    [self presentViewController:mailPicker animated:YES completion:nil];}- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {    [self dismissViewControllerAnimated:YES completion:nil];}

Generally, the second type is used.


How does ios determine that MFMailComposeViewController is successfully sent?

The mail App does not exist in the simulator. You need to call the email. You must set the email address to debug the device.

How does iOS send emails without calling the system email interface?

Install other email software.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.