5

I am using MFMailComposeViewController to Compose email with attachment and it's working fine

Now I want to compose image with attachment with native email client. I am using code below

 NSString *customURL =[NSString stringWithFormat:@"googlegmail:///co?to=[t0]&subject=[subject]&body=[body]"];

    NSURL *url = [NSURL URLWithString:customURL];
    if ([[UIApplication sharedApplication]
         canOpenURL:url])
    {

        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {

            NSLog(@"%d",success);
        }];
    }
    else
    {
        //not installed, show popup for a user or an error
    }

It's working fine with subject and Body, but I am not able to attach attachments(ie:Zip file, screen shots).

is there any way to add attachment, while using gmail or any other client app.

Avnish Yadav
  • 104
  • 8
  • This link could be helpful:https://stackoverflow.com/questions/7824647/send-an-iphone-attachment-through-email-programmatically – iOS Jan 10 '19 at 13:41
  • @Abhishek above link shared by you uses `MFMailComposeViewController `, I don't want to use it, I want to use another email client ie: gmail, yahoo-mail or office – Avnish Yadav Jan 15 '19 at 09:21
  • Have you found a solution on this? – Skoempie Mar 03 '20 at 10:42

0 Answers0