java - how to send html email in android? -
hi making app in sending email specific address
this email html email table , images , all...
is have tried add html.fromhtml()
keeps saying type mismatch needed string found spanned....
if need of code please comment
please suggest tutorial if have in mind
edit forgot mention sending mail using javax.mail
library not using intents tried use html.tohtml(spanned text)
giving message of type mismatch cant convert string spannedtext
i have no idea whats happening
i receiving html data in mail if go it
update fetching content string resource , getting result
$message = ' support enquiry@makeintern.comcontact form enquiry ! name: :'.$name.'email: :'.$email.'contact: :'.$mobile.'message: :'.$message.'date-time: :'.$current_date.'
thanks , regards makeintern team account manager - makeintern cell www.makeintern.com enquiry@makeintern.com
if query please call on : 011-45544188  www.makeintern.com | enquiry@makeintern.com 
from---
<string name="email">$message = \'<center> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#ffffff"> <table width="620px" cellpadding="0" cellspacing="0"> <tr> <td width="400px" bgcolor="#000000" style="color:#ffffff; text- decoration:none; float:left;font-size:10px;margin: -18px 3px -1px 11px; font-weight:bold; padding:2px; text-decoration:none; padding-left:0px;">for support <span style="text-decoration:none; color:#ffffff;">enquiry@makeintern.com</span></td> <td width="220px" bgcolor="#000000"></td> </tr> <tr style="background-color:#737373;"> <td width="290" align="left" valign="middle"><a href="http://makeintern.com" target="_blank"><img src="http://www.makeintern.com/images/makeintern.jpg" width="136" border="0" alt="makeintern" style="display:block; padding-left:0px;"></a></td> <td width="290" align="right" style="text-align:right; font-family:arial, segoe ui,helvetica neue, helvetica, sans-serif; font-size:18px; line-height:18px; color:#ffffff; font-weight:normal; padding-right:10px;">contact form enquiry !<br> </td> </tr> <tr> <td height="12px" colspan="2"></td> </tr> <tr> <td colspan="2" align="center" style="line-height:16px; font-family:arial; font-size:12px; color:#888888; text-align:left;"> <table cellspacing="0" cellpadding="0"> <tr> <td width="200px" style="font-weight:bold;">name: </td> <td width="100px">:</td> <td>\'.$name.\'</td> </tr> <tr> <td width="200px" style="font-weight:bold;">email: </td> <td width="100px">:</td> <td>\'.$email.\'</td> </tr> <tr> <td width="200px" style="font-weight:bold;">contact: </td> <td width="100px">:</td> <td>\'.$mobile.\'</td> </tr> <tr> <td width="200px" style="font-weight:bold;">message: </td> <td width="100px">:</td> <td>\'.$message.\'</td> </tr> <tr> <td width="200px" style="font-weight:bold;">date-time: </td> <td width="100px">:</td> <td>\'.$current_date.\'</td> </tr> </table> <br/><br/> , regards <br/> makeintern team <br/> account manager - makeintern cell <br/> www.makeintern.com<br/> enquiry@makeintern.com<br/><br/> <b>if query please call on : 011-45544188</b><br/> </td> </tr> <tr> <td height="12px"></td> </tr> <tr> <td colspan="2"><img src="http://www.myhotbooking.com/images/email-template/bar.png"></td> </tr> <tr> <td colspan="2" bgcolor="#737373" height="90px"> <table cellpadding="0" cellspacing="0" width="620px"> <tr> <td height="10px"></td> </tr> <tr> <td align="center" style="color:#ffffff;" height="20px"><a href="http://www.makeintern.com/">www.makeintern.com </a>| <span style="color:#ffffff; text-decoration:none;">enquiry@makeintern.com</span></td> </tr> <tr> <td align="center" valign="middle"> <a href="https://www.facebook.com/makeinterns" target="_blank"><img src="http://www.myhotbooking.com/images/email-template/icon-facebook.png" width="26" height="26" border="0" alt="facebook"></a><a href="https://twitter.com/makeintern" target="_blank"><img src="http://www.myhotbooking.com/images/email-template/icon-twitter.png" width="26" height="26" border="0" alt="twitter"></a><a href="https://www.linkedin.com/company/makeintern" target="_blank"><img src="http://www.myhotbooking.com/images/email-template/icon-linkedin.png" width="26" height="26" border="0" alt="linkedin"></a><a href="https://plus.google.com/+makeintern" target="_blank"><img src="http://www.myhotbooking.com/images/email-template/icon-google-plus.png" width="26" height="26" border="0" alt="google+"></a></td> </tr> <tr> <td align="center" style="color:#ffffff;"></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </center>\'</string>
thankyou in advance
have use code:
final intent shareintent = new intent(intent.action_sendto, uri.parse("mailto:")); shareintent.putextra(intent.extra_subject, "the subject"); shareintent.putextra( intent.extra_text, html.fromhtml(new stringbuilder() .append("<p><b>some content</b></p>") .append("<small><p>more content</p></small>") .tostring()) );
if not please try . hope ! cheers !
update:
textview contentview = (textview)view.findviewbyid(r.id.contentpreview); spannablestring contenttext = (spannablestring) contentview.gettext(); string htmlencodedstring = html.tohtml(contenttext); string decodedstring = stringescapeutils.unescapehtml4(htmlencodedstring); log.e("content text",decodedstring);
use decode , encode
Comments
Post a Comment