Android - Mailto

533 views
Skip to first unread message

Joseph Saadé

unread,
Jul 20, 2010, 4:51:18 AM7/20/10
to phonegap
I have been trying to figure this out for a few days. I searched all
over the web and I cannot believe that I am the only person with this
issue.

When I have I click on a mailto link inside the app, the simulator and
the device both redirect me to a page where it says: "Web page not
available ...."

I am bit new to android, I was browsing the phonegap java source and
saw you were calling a new Intent on mailto:
else if(url.startsWith("mailto:"))
{
Intent mail = new Intent(Intent.ACTION_SENDTO, Uri.parse(url));
startActivity(mail);
return true;
}

Should I add a new intent filter for this? if yes then How?
I also noticed the PhoneGap Demo app does not have an email button
test so I am confused whether sending an email is supported on android
or not?

mobweb

unread,
Jul 20, 2010, 7:38:57 AM7/20/10
to phonegap
I'm pretty sure that on an older project I had mailto working on
Android, but the project is on another machine that I don't have
access to right now. Have you tried <a
href="javascript:window.location.href = 'mailto:... ? Also, have you
tried it on an actual device? Could be that the simulator doesn't have
any E-mail support (not sure tho)

Joseph Saadé

unread,
Jul 20, 2010, 8:23:11 AM7/20/10
to phonegap

Joseph Saadé

unread,
Jul 20, 2010, 8:11:35 AM7/20/10
to phonegap
I tried it on actual device, I have it:
<a href="mailto:te...@test.com">email</a>
it just gives "page not found"


On Jul 20, 2:38 pm, mobweb <i...@mobweb.ch> wrote:

danmayer

unread,
Jul 20, 2010, 10:40:48 PM7/20/10
to phonegap
I don't have time to test this now, but my guess is that this is
related to phonegaps special URI handling. It does special things to
try to keep everything on the one file that phonegap uses. Phonegap
has special handling for tel:// and external web addresses. My guess
that this code is at fault. I might have some time to take a look at
it tomorrow. Hopefully that helps.

peace,
Dan Mayer

On Jul 20, 8:11 am, Joseph Saadé <jsa...@gmail.com> wrote:
> I tried it on actual device, I have it:
> <a href="mailto:t...@test.com">email</a>

Joseph Saadé

unread,
Jul 22, 2010, 4:23:42 AM7/22/10
to phonegap
IT is a very weird behavior.
I deployed the same app on a blackberry, nokia and iphone and it works
fine.
Only Android does not respond to "mailto" hrefs.

Joseph Saadé

unread,
Jul 26, 2010, 6:08:15 AM7/26/10
to phonegap
Any updates?

On Jul 22, 11:23 am, Joseph Saadé <jsa...@gmail.com> wrote:
> IT is a very weird behavior.
> I deployed the same app on a blackberry, nokia and iphone and it works
> fine.
> OnlyAndroiddoes not respond to "mailto" hrefs.
>
> On Jul 21, 5:40 am, danmayer <danma...@gmail.com> wrote:
>
> > I don't have time to test this now, but my guess is that this is
> > related to phonegaps special URI handling. It does special things to
> > try to keep everything on the one file that phonegap uses. Phonegap
> > has special handling for tel:// and external web addresses. My guess
> > that this code is at fault. I might have some time to take a look at
> > it tomorrow. Hopefully that helps.
>
> > peace,
> > Dan Mayer
>
> > On Jul 20, 8:11 am, Joseph Saadé <jsa...@gmail.com> wrote:
>
> > > I tried it on actual device, I have it:
> > > <a href="mailto:t...@test.com">email</a>
> > > it just gives "page not found"
>
> > > On Jul 20, 2:38 pm, mobweb <i...@mobweb.ch> wrote:
>
> > > > I'm pretty sure that on an older project I hadmailtoworking on
> > > >Android, but the project is on another machine that I don't have
> > > > access to right now. Have you tried <a
> > > > href="javascript:window.location.href = 'mailto:... ? Also, have you
> > > > tried it on an actual device? Could be that the simulator doesn't have
> > > > any E-mail support (not sure tho)
>
> > > > On 20 Jul., 10:51, Joseph Saadé <jsa...@gmail.com> wrote:
>
> > > > > I have been trying to figure this out for a few days. I searched all
> > > > > over the web and I cannot believe that I am the only person with this
> > > > > issue.
>
> > > > > When I have I click on amailtolink inside the app, the simulator and
> > > > > the device both redirect me to  a page where it says: "Web page not
> > > > > available ...."
>
> > > > > I am  bit new toandroid, I was browsing the phonegap java source and

krisg

unread,
Aug 30, 2010, 2:11:19 PM8/30/10
to phonegap
this is a bug in DroidGap.

GapViewClient.shouldOverrideUrlLoading does not support mailto:
scheme. it also handles tel:// only (I think tel:xxxxxx is more
common...).

I've modified this method as it was described here
http://groups.google.com/group/android-developers/browse_thread/thread/ddc289d7701f944e/88c38bfa7d1a2a2a?lnk=gst&q=tel%253A

and it works fine.
Reply all
Reply to author
Forward
0 new messages