0

アプリに埋め込まれた HTML があり、アプリ内でそれを電子メールで送信できるようにしたいと考えています。以下のコードを設定しました。メールからテキストをメールで送信しますが、埋め込まれた画像は添付しません。これは、baseURL が適切に設定されていないことが原因だと思いますが、emailBody に対してそれを行う方法がわかりません。何かご意見は?

NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"Thanks" ofType:@"html"];
    NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:@"A prayer gift of thanks to you"];


    // Set up recipients
    NSArray *toRecipients = [NSArray arrayWithObject:@"friend@example.com"];

    [picker setToRecipients:toRecipients];

    // Fill out the email body text
    NSString *emailBody = htmlString;
    [picker setMessageBody:emailBody isHTML:YES];
4

1 に答える 1