在iPhone的HTML邮件中显示本地图像 [英] Display local image in iPhone HTML mail

查看:156
本文介绍了在iPhone的HTML邮件中显示本地图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我正在使用3.0+ MFMailComposeViewController 编写一个HMTL电子邮件。
为此,我创建了一个HTML文件,其中包含一些占位符。
在我的代码中,我读取了HTML文件,并且使用 replaceOccurrencesOfString ,我用来自应用程序的数据替换占位符。
这样我就组成了我想发送的电子邮件的正文。
这都是非常好的工作,除了事实上,在我的HTML文件中,我有一个< img src ='imageplaceholderpath'/> 标签。
不知怎的,我不清楚,我应该替换这个 imageplaceholderpath ,以引用驻留在我的应用程序中的图像。
这是一个有效的方法,如果是这样,我应该放在那里的路径背后的语法/逻辑是什么?
我很感激你的见解!
Regards
Sjakelien

解决方案

不幸的是,这不支持iPhone 3.x API。 p>

http://developer.apple.com/iphone/library/documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html



它将需要Content-ID:作为附件子部分的一部分,但不是。 (NSString *)文件名$($)$($) b $ b


In my app, I am composing an HMTL email message with the 3.0+ MFMailComposeViewController. To do this, I created an HTML file, with some placeholders. In my code, I read the HTML file, and with replaceOccurrencesOfString, I replace the placeholders with data from the app. In that way, I compose the body of the email I want to send out. This is all working very nicely, except for the fact, that in my HTML file, I have an <img src='imageplaceholderpath' /> tag. Somehow, I cannot figure out, with what I should replace this imageplaceholderpath, in order to refer to an image that resides in my app. Is this a valid approach at all, and if so, what would be the syntax/logic behind the path I should put there? I do appreciate your insights! Regards Sjakelien

解决方案

Unfortunately this is not supported by the iPhone 3.x APIs.

http://developer.apple.com/iphone/library/documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html

It would require Content-ID: to be part of the attachment subpart but it is not.

 - (void)addAttachmentData:(NSData*)attachment mimeType:(NSString*)mimeType fileName:(NSString*)filename

这篇关于在iPhone的HTML邮件中显示本地图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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