0

我想在我的网站上有一个联系按钮,当用户单击 Gmail 撰写邮件时,该按钮会在 Gmail 网站中使用电子邮件地址打开。有人知道如何实现这一目标吗?

4

1 回答 1

0

在mailto上使用Open Gmail的解决方案做了一个例子:action

$('#go').click(function(event){
var email =  $('#email').val();
if(email)
window.location.href = 'https://mail.google.com/mail/?view=cm&fs=1&to='+email;
else
alert('please enter your email');
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span>Please Enter Your Email And Go</span>
<br />
<input id="email" />

<button id="go">Go!</button>

于 2018-06-05T01:33:29.243 回答