Skip to content

Commit fb40429

Browse files
Fix HTML email sending on Android API 24+ (#4346)
Fixed #3386 Added `android.intent.extra.HTML_TEXT` to the email intent when sending HTML messages. This ensures modern email clients (like Gmail) render the HTML content correctly instead of stripping it or displaying plain text. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 1c10534 commit fb40429

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6977,6 +6977,7 @@ public void sendMessage(String[] recipients, String subject, Message msg) {
69776977
}
69786978
if (msg.getMimeType().equals(Message.MIME_HTML)) {
69796979
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(msg.getContent()));
6980+
emailIntent.putExtra("android.intent.extra.HTML_TEXT", msg.getContent());
69806981
}else{
69816982
/*
69826983
// Attempted this workaround to fix the ClassCastException that occurs on android when

0 commit comments

Comments
 (0)