
但发送电子邮件时不支持所有标签的样式.
这是我的@L_419_0@代码:
Intent emailintent = new Intent(androID.content.Intent.ACTION_SENDTO,Uri.fromParts("mailto","",null));emailintent.putExtra(androID.content.Intent.EXTRA_SUBJECT,"Look What I Found!");emailintent.putExtra(androID.content.Intent.EXTRA_TEXT,HTML.fromHTML(mMessage));startActivity(emailintent);` 这是我的HTML,我要发送的内容:
"<!DOCTYPE HTML> <HTML lang="en"> <head> <Meta charset="UTF-8"> <Title>document</Title> </head> <body> <center> <table cellpadding="0" cellspacing="0"> <tr> <td> <table> <tr> <td> <img src="https://www.twinspires.com/sites/twinspires.com/files/header-600x123.jpg" alt="Churchill Downs" > </td> </tr> </table> <table > <tr> <td > </td> <td> <p >VIEw this shared article from the Churchill Downs Incorporated Magazine $Title. Download the official lifestyle app of Churchill Downs – "Club 1875" to access the elegant world of Thoroughbred racing and the Kentucky Derby. Stay up to date on fashion,food,celebritIEs and some of the most recognizable names in the industry. Club 1875 is your behind the scenes guIDe to the most exciting two minutes in sports – whether you’re at the track or far away! </p> </td> <td > </td> </tr> </table> <center> <table> <tr> <td> <img src="https://www.twinspires.com/sites/twinspires.com/files/logo-235x98-02.jpg" alt="" alt="CLUB 1875"> </td> </tr> </table> </center> <center> <table> <tr> <td> <a href="https://itunes.apple.com/us/app/club-1875/ID1171549047?mt=8" target="_blank"><img src="https://www.twinspires.com/sites/twinspires.com/files/icon-148x40-02.jpg" alt="Download Here" ></a> </td> </tr> </table> </center> <center> <table > <tr> <td> <img src="https://www.twinspires.com/sites/twinspires.com/files/footer-558x278.jpg" a"
这是我发送电子邮件时的输出:
解决方法 试试这个吧.String mailID="yourmail@gmail.com";Intent emailintent = new Intent(Intent.ACTION_SENDTO,mailID,null)); emailintent.putExtra(androID.content.Intent.EXTRA_SUBJECT,"Subject text here"); // you can use simple text like this// emailintent.putExtra(androID.content.Intent.EXTRA_TEXT,"Body text here"); // or get fancy with HTML like thisemailintent.putExtra( Intent.EXTRA_TEXT,HTML.fromHTML(new StringBuilder() .append("<p><b>Some Content</b></p>") .append("<a>http://www.Google.com</a>") .append("<small><p>More content</p></small>") .toString()) );startActivity(Intent.createChooser(emailintent,"Send email...")); 总结 以上是内存溢出为你收集整理的如何在android中以html格式的电子邮件发送图像?全部内容,希望文章能够帮你解决如何在android中以html格式的电子邮件发送图像?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)