如何使用 Adobe Air 启动邮件应用程序并附加 iPhone 中 applicationStorageDirectory 中的图像
我已经尝试过:
var fn:String = "image.png";
var f:File = File.applicationStorageDirectory.resolvePath(fn);
var subject:String = "My encrypted Image";
var body:String = "<html><head><body><img src=\""+f.url+"\"></body></head></html>";
var url:String = "mailto:?subject="+subject+"&body=" + body;
navigateToURL( new URLRequest( url ), '_self' );
这确实会启动邮件应用程序,但它显示一个“?”图标,这意味着它找不到我的完整应用程序存储路径。
有什么想法吗?
谢谢
I've tried:
var fn:String = "image.png";
var f:File = File.applicationStorageDirectory.resolvePath(fn);
var subject:String = "My encrypted Image";
var body:String = "<html><head><body><img src=\""+f.url+"\"></body></head></html>";
var url:String = "mailto:?subject="+subject+"&body=" + body;
navigateToURL( new URLRequest( url ), '_self' );
This does launch the Mail app but it displays a "?" icon, which means it can't find my full app-storage path.
Any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了一个解决方案:
不要放置文件路径,而是放置图像的 Base64 编码字符串,例如:
更多信息:
http://en.wikipedia.org/wiki/Data_URI_scheme
从 ByteArray 转换为 Base64:
http://www.lorenzgames.com /blog/convert-an-image-to-base64-string-and-versa
I found a solution:
instead of putting the file path, put a Base64 encoded string of the image, for example:
More info:
http://en.wikipedia.org/wiki/Data_URI_scheme
To convert from ByteArray to Base64:
http://www.lorenzgames.com/blog/convert-an-image-to-base64-string-and-vice-versa
您也可以尝试 MilkMan Games 的 GoViral ane。
在该页面中搜索 showEmailComposerWithBitmap()
You might also try the GoViral ane from MilkMan Games.
Search that page for showEmailComposerWithBitmap()