如何在邮件作曲家附上两张图片 [英] how can attach two images in mail composer

查看:180
本文介绍了如何在邮件作曲家附上两张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个iPhone邮件插入图像的iPhone项目。这些图像是从照片库中选择的,它们存储在两个单独的图像视图中。

解决方案

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

  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取决于消息体
[object presentModalViewController:controller animated:YES];
RELEASE_SAFELY(控制器);

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


I am making an iPhone project for inserting two images in mail. The images are selected from the photo library and they're stored in two separate image views. When I attach the images in email, it doesn't attach it correctly.

解决方案

You can create a html page code and insert that image as tag and pass the whole html as string in the MFMailComposer for Body.It will look cool. you need write this line

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);

Once you will implement the MFMailComposer you need to set bool if you are using html page in body.Let me know if you have any doubt.

这篇关于如何在邮件作曲家附上两张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆