fiacobelli
fiacobelli

Reputation: 1990

is there a way to use HTML to send an email via gmail

The tag mailto: in a link opens the default email client. However, many of the people I want to code for use GMail.

So, is there a way to craft an email and access the user's gmail tab so that the all she/he has to do is to click send?

Upvotes: 2

Views: 5731

Answers (4)

mrmoje
mrmoje

Reputation: 3732

"Crafting an email and access the user's gmail tab" = XSS which is unethical.
One way to achieve what you want is to ask your users to make their Gmail handle mailto: links by following this guide -> https://support.google.com/mail/answer/10966?hl=en

Upvotes: 2

HuRN
HuRN

Reputation: 71

Use the anchor like that:

<a href="https://mail.google.com/mail/?view=cm&fs=1&[email protected]&su=subject_here&body=body_here"></a>

Upvotes: 2

Shaunak
Shaunak

Reputation: 18026

No such way to set it from inside your applications. But gmail does provide you setting to open mailto links in gmail.

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1039438

I am afraid that there isn't such way. It's not something that you should be attempting to solve in your web application because user agents might behave differently. So just leave it that way.

Upvotes: 4

Related Questions