Android - preset email body

240 views
Skip to first unread message

ScottP

unread,
Oct 5, 2010, 10:28:06 AM10/5/10
to phonegap
I know android mailto links have been discussed here before but I am
looking to send a preset email body from my within app.
The iphone plugin (emailcomposer) works terrifically. I have not seen
a plugin for android for in-app emails.

For my android version, I currently have a mailto link setup,
something like:
mailto:so...@email.com?subject&body

Mail client opens with the this method but I haven't been able to
figure out how to get line breaks/carriage returns in the email body.
I've tried using html in the body but the email when viewed just shows
the html code - not marked up.
I've also tried using %0D%0A with no luck.

So questions are:
1. Is there a different way to send in-app email with phonegap for
android (other than mailto links) that allows formatted body content?
some plugin I'm missing?
2. Has anybody successfully done a mailto link with formatted body
content?
Thanks!

Bryce Curtis

unread,
Oct 5, 2010, 11:48:45 AM10/5/10
to phonegap
This works on the latest Edge version of Android:

<a href="mailto:m...@abc.com?subject=My Subject&body=This is the
body.%0D%0ANew line.">Send Mail</a>


On Oct 5, 9:28 am, ScottP <scott.a.padi...@gmail.com> wrote:
> I know android mailto links have been discussed here before but I am
> looking to send a preset email body from my within app.
> The iphone plugin (emailcomposer) works terrifically.  I have not seen
> a plugin for android for in-app emails.
>
> For my android version, I currently have a mailto link setup,
> something like:
> mailto:s...@email.com?subject&body

ScottP

unread,
Oct 5, 2010, 9:18:04 PM10/5/10
to phonegap
Thanks Bryce.
Knowing that it worked for you - I looked at it more deeply and
realized that I was using encodeURIComponent(). This was messing with
the %0D%0A character code. I actually ended up using "\n" because of
the encodeURIComponent().
If I didn't encode it then the %0D%0A would've worked.
So thanks again.
Reply all
Reply to author
Forward
0 new messages