java - how to send html email in android? -


hi making app in sending email specific address

this email html email table , images , all...like this

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.maillibrary 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 = \'&lt;center&gt;    &lt;table width="100%" cellpadding="0" cellspacing="0"&gt;    &lt;tr&gt;   &lt;td align="center" bgcolor="#ffffff"&gt;     &lt;table width="620px" cellpadding="0" cellspacing="0"&gt;     &lt;tr&gt;         &lt;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;"&gt;for support &lt;span style="text-decoration:none; color:#ffffff;"&gt;enquiry@makeintern.com&lt;/span&gt;&lt;/td&gt; &lt;td width="220px" bgcolor="#000000"&gt;&lt;/td&gt; &lt;/tr&gt;  &lt;tr style="background-color:#737373;"&gt; &lt;td width="290" align="left" valign="middle"&gt;&lt;a href="http://makeintern.com" target="_blank"&gt;&lt;img src="http://www.makeintern.com/images/makeintern.jpg" width="136" border="0" alt="makeintern" style="display:block; padding-left:0px;"&gt;&lt;/a&gt;&lt;/td&gt; &lt;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;"&gt;contact form enquiry !&lt;br&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="12px" colspan="2"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" align="center" style="line-height:16px; font-family:arial; font-size:12px; color:#888888; text-align:left;"&gt; &lt;table cellspacing="0" cellpadding="0"&gt; &lt;tr&gt;         &lt;td width="200px" style="font-weight:bold;"&gt;name: &lt;/td&gt;         &lt;td width="100px"&gt;:&lt;/td&gt;         &lt;td&gt;\'.$name.\'&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;         &lt;td width="200px" style="font-weight:bold;"&gt;email: &lt;/td&gt;         &lt;td width="100px"&gt;:&lt;/td&gt;         &lt;td&gt;\'.$email.\'&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;         &lt;td width="200px" style="font-weight:bold;"&gt;contact: &lt;/td&gt;         &lt;td width="100px"&gt;:&lt;/td&gt;         &lt;td&gt;\'.$mobile.\'&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;         &lt;td width="200px" style="font-weight:bold;"&gt;message:  &lt;/td&gt;         &lt;td width="100px"&gt;:&lt;/td&gt;         &lt;td&gt;\'.$message.\'&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;         &lt;td width="200px" style="font-weight:bold;"&gt;date-time:  &lt;/td&gt;         &lt;td width="100px"&gt;:&lt;/td&gt;         &lt;td&gt;\'.$current_date.\'&lt;/td&gt;         &lt;/tr&gt;           &lt;/table&gt;          &lt;br/&gt;&lt;br/&gt;          , regards &lt;br/&gt;         makeintern team &lt;br/&gt;         account manager - makeintern cell &lt;br/&gt;         www.makeintern.com&lt;br/&gt;         enquiry@makeintern.com&lt;br/&gt;&lt;br/&gt;         &lt;b&gt;if query please call on : 011-45544188&lt;/b&gt;&lt;br/&gt;         &lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;         &lt;td height="12px"&gt;&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;         &lt;td colspan="2"&gt;&lt;img src="http://www.myhotbooking.com/images/email-template/bar.png"&gt;&lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;         &lt;td colspan="2" bgcolor="#737373" height="90px"&gt;         &lt;table cellpadding="0" cellspacing="0" width="620px"&gt;         &lt;tr&gt;         &lt;td height="10px"&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;         &lt;td align="center" style="color:#ffffff;" height="20px"&gt;&lt;a href="http://www.makeintern.com/"&gt;www.makeintern.com &lt;/a&gt;| &lt;span style="color:#ffffff; text-decoration:none;"&gt;enquiry@makeintern.com&lt;/span&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;         &lt;td align="center" valign="middle"&gt;         &lt;a href="https://www.facebook.com/makeinterns" target="_blank"&gt;&lt;img src="http://www.myhotbooking.com/images/email-template/icon-facebook.png" width="26" height="26" border="0" alt="facebook"&gt;&lt;/a&gt;&lt;a href="https://twitter.com/makeintern" target="_blank"&gt;&lt;img src="http://www.myhotbooking.com/images/email-template/icon-twitter.png" width="26" height="26" border="0" alt="twitter"&gt;&lt;/a&gt;&lt;a href="https://www.linkedin.com/company/makeintern" target="_blank"&gt;&lt;img src="http://www.myhotbooking.com/images/email-template/icon-linkedin.png" width="26" height="26" border="0" alt="linkedin"&gt;&lt;/a&gt;&lt;a href="https://plus.google.com/+makeintern" target="_blank"&gt;&lt;img src="http://www.myhotbooking.com/images/email-template/icon-google-plus.png" width="26" height="26" border="0" alt="google+"&gt;&lt;/a&gt;&lt;/td&gt;           &lt;/tr&gt;         &lt;tr&gt;         &lt;td align="center" style="color:#ffffff;"&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;/table&gt;         &lt;/td&gt;         &lt;/tr&gt;         &lt;/table&gt;         &lt;/td&gt;         &lt;/tr&gt;         &lt;/table&gt;         &lt;/center&gt;\'</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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -