创建一个Gmail共享链接 [英] Create a Gmail share link

查看:139
本文介绍了创建一个Gmail共享链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的一页Web应用程序上放置一个按钮,该按钮允许用户通过Gmail发送链接.我发现某些网站(例如addthis.com)提供了这样的按钮,但是此按钮会自动使用网址栏中的链接.由于我有一个网页Web应用程序,因此网址栏中的链接将始终相同.我需要能够自己将链接放在按钮中(例如,使用Facebook和Twitter共享按钮就可以).

I would like to put a button on my one page web application that allows a user to send a link through Gmail. I found that some websites such as addthis.com provide such a button, however this button automatically uses the link from the url bar. Since I have a one page web application the link in the url bar will always be the same. I need to be able to to put the link in the button myself (which is possible with, for example, the Facebook and Twitter share buttons).

如何创建可用于共享链接的Gmail按钮?

How can I create a Gmail button that can be used to share a link?

谢谢.

推荐答案

在按钮"上单击以编写一个函数,然后在该函数内部执行此操作

On Button click write a function and do this inside the function

let url = 'https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=&su=Your+Subject+here&body='+msgbody+'&ui=2&tf=1&pli=1';

window.open(url, 'sharer', 'toolbar=0,status=0,width=648,height=395');

该网址将生成一个链接,以打开一个带有自动填充主题的gmail标签,并代替msgbody来放置您要共享的网址.

The url will generate a link to open a gmail tab with auto filled subject and in in place of msgbody you can put your url you want to share.

这篇关于创建一个Gmail共享链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆