如何在邮件编辑器中附加两个图像

问题描述 投票:1回答:1

我正在制作一个iPhone项目,用于在邮件中插入两个图像。从照片库中选择图像,并将它们存储在两个单独的图像视图中。当我在电子邮件中附加图像时,它没有正确附加它。

iphone email ios5
1个回答
0
投票

您可以创建一个html页面代码并将该图像作为标记插入,并将整个html作为字符串传递给MFMailComposer for Body。它看起来很酷。你需要写这一行

MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
        controller.mailComposeDelegate = self;
        if ([recipentArray count]>0) 
        {
            [controller setToRecipients:self.recipentArray];
        }
        [controller setSubject:self.emailSubject];
        [controller setMessageBody:self.messageBody isHTML:YES]; // isHTML -> YES/NO depending the message body
        [object presentModalViewController:controller   animated:YES];
        RELEASE_SAFELY(controller);

一旦你将实现MFMailComposer,你需要设置bool,如果你在正文中使用html页面。让我知道你是否有任何疑问。

© www.soinside.com 2019 - 2024. All rights reserved.