丢失电子邮件android中的超链接

时间:2013-01-03 16:51:02

标签: android android-intent html-email

我试过这个

Intent mIntent = new Intent(Intent.ACTION_SEND);
mIntent.putExtra(Intent.EXTRA_SUBJECT, "this is test");
mIntent.setType("text/html");  
Uri myUri = Uri.parse("http://www.Google.com/");
mIntent.putExtra(android.content.Intent.EXTRA_TEXT,Html.fromHtml("<a href=\""+myUri+"\">Link</a>"));
            context.startActivity(android.content.Intent.createChooser(mIntent, "Email:"));

我也尝试过  的setType( “消息/ RFC822”);

一切都是徒劳的,我没有电子邮件的问题(工作正常)。但我无法看到超链接,在另一端收到的原始消息甚至没有超链接href下面显示的内容

*MIME-Version: 1.0
Received: by 10.49.25.98 with HTTP; Thu, 3 Jan 2013 08:42:55 -0800 (PST)
Received: by 10.49.25.98 with HTTP; Thu, 3 Jan 2013 08:42:55 -0800 (PST)
Date: Thu, 3 Jan 2013 11:42:55 -0500
Delivered-To: DELETED
Message-ID: DELETED
Subject: this is test
From: DELETED
To: DELETED
Content-Type: multipart/alternative; boundary=047d7bea41ce0280df04d2650e27
--047d7bea41ce0280df04d2650e27
Content-Type: text/plain; charset=ISO-8859-1
Link
--047d7bea41ce0280df04d2650e27
Content-Type: text/html; charset=ISO-8859-1
<p dir="ltr">Link</p>
--047d7bea41ce0280df04d2650e27--*

1 个答案:

答案 0 :(得分:0)

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,Html.fromHtml(emailtext.toString()));
emailIntent.setType("text/html");
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

适用于设置为:

的电子邮件文本
String emailtext = "<a href="+actionUrl+">"+shareTextContent+"</a>";

动作网址可能类似于:

actionUrl = "www.google.com"