2

I have the code for a click to email link in HTML and it works fine on my pc but doesn't work on mobile devices (I only have Android so I don't know if the problem is only on Android or all mobile devices). When I press the link the browser says:

Webpage not available. "mailto:ar1speed@yahoo.com?subject=Mileage%20%20%20&body="Todays%20date:%0D%0ABusiness%20Mileage:%0D%0ADid%20you%20have%20a%20business%20passenger?%0D%0AAdditional%20details:" might be temporarily down or it may have moved permanently to a new web address.

Can someone please tell me how to fix this problem it is vital that the Click to send email link works.

My code is below:

<p>
   <a href="mailto:ar1speed@yahoo.com?subject=Mileage&body="Todays date:%0D%0ABusiness Mileage:%0D%0ADid you have a business passenger%0D%0AAdditional details:">
       Click to send email
   </a>
</p>
Rarepuppers
  • 723
  • 1
  • 10
  • 21
Pancake_Senpai
  • 915
  • 5
  • 12
  • 19

4 Answers4

1

That's an issue with Android OS:

Issue 63538: Mailto links are parsed incorrectly, entered entirely into the address field

Devices Confirmed: Nexus 4 (two devices tested)
Android Version: 4.4.2 only (tested in 4.3 and 4.4.0)

Bug details:

Mailto links are entirely entered into the address field instead of being parsed into Address, Subject and Body. Screenshot is attached showing issue.

Community
  • 1
  • 1
Rathore
  • 1,926
  • 3
  • 19
  • 29
0

Here's an example of mailto which works just fine on mobile, so you must've just formed your URL incorrectly (check your ""s).

MAILTO Link in email to start a new email

Community
  • 1
  • 1
whitfin
  • 4,539
  • 6
  • 39
  • 67
0

Your application need access for mail related apps.This can be achieved by adding following piece of code in

config.xml

<access origin="mailto://*" launch-external="true" /> 

then it will work

0

Use this code to invoke the mailing applications in mobile and set the subject, and body of email as well.

Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse("mailto:yourmailid@somedomain.com"));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Body");

                try {
                    startActivity(emailIntent);
                } catch (ActivityNotFoundException e) {
                    Toast.makeText("No email client found",
                            Toast.LENGTH_LONG).show();
                }

Refer Send Email Intent for examples

Maria
  • 369
  • 2
  • 7