2

I am sending mail with html format and it's format is below

    nameValuePairs.add(new BasicNameValuePair("message", "<b> Your Last Alert: </b> <br/><br/>  On " + "<font color=\"red\"> " + mDate
                + "</font>" + " at " + "<font color=\"red\"> " + mTime + "</font>" + ", " + "\"<font color=\"red\">" + model + "</font>\""
                + " reported that its battery level was down to " + "<font color=\"red\"> " + batteryLevel + "%.</font>"
                + "<br/> You might want to get it on a charger before it's too late! <br/><br/><br/><br/><b> Do you know where \""
                + "<font color=\"red\">" + model + "</font>\"" + " is? </b><br/><br/> Click " + "<a href=\"" + s + "\"> here </a>"
                + " to view in Google Maps.<br/> To find \"<font color=\"red\">"+ model +"</font>\" with the Last Alert app on another iOS device, click <a href = \"" + linkForiPhone
                + "\"> here </a>. <br/>" + "Android users, Click <a href = \"" + linkForAndroid
                + "\"> here </a>. <br/><br/><br/><b><u> Last Known Location : </u></b><br/> " + address
                + "<br/><br/><br/><br/><br/><b><u>GPS Coordinates</b></u> <br/>" + cutLat + ", " + cutLong
                + "<br/><br/><b><u>Altitude</b></u><br/>" + alt + " " + "<br/><br/><b><u>Location Accuracy</b></u>" + "<br/>" + diameter
                + " Diameter"));

when i open this mail on android it's looking great but on iphone it's not looking in proper format it is showing like below

enter image description here

in Android it is looking fine like below

enter image description here

What is wrong?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Siddhpura Amit
  • 14,534
  • 16
  • 91
  • 150
  • I don't know if this will work, but try `` in the `` of your html page – HashtagMarkus Dec 07 '12 at 10:36
  • Does this answer your question? [Mobile Safari/ iPhone Mail.app HTML design issues: prevent autolinking and styling auto-links (dates, addresses, etc.)](https://stackoverflow.com/questions/5265443/mobile-safari-iphone-mail-app-html-design-issues-prevent-autolinking-and-styli) – Nimantha Nov 18 '21 at 11:45

1 Answers1

0

You can link directly to the maps app for an address using

<a href=http://maps.google.com/maps?q=address>address</a>

and probably avoid the mail app's auto-formatting.

Andy McSherry
  • 4,676
  • 3
  • 26
  • 36