how to insert gmail composing button in my website

前端 未结 3 1701
栀梦
栀梦 2021-01-17 07:15

i have gmail mail icon link.when i click the link it will open gmail compose message(when user already login) otherwise it will goto gmail login page.

Exatly like my

相关标签:
3条回答
  • 2021-01-17 07:56

    A quick google search and here is your answer. Just use the given URL instead of mailto:

    Example:

    <a target="_blank" href="https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=youremail@gmail.com&body=my-text">Click here to email</a>
    

    Source

    0 讨论(0)
  • 2021-01-17 07:57

    You can add a new line with %0a instead of \n for gmail and some other email clients.

    0 讨论(0)
  • 2021-01-17 07:57

    You can send mail with subject. Open with popup Modal Box:-

    <script type="text/javascript" async >
        function genericSocialShare(url){
           window.open(url,'sharer','toolbar=0,status=0,width=648,height=395');
           return true;
        }
    </script>
    
    <a href="javascript:void(0)" onclick="javascript:genericSocialShare('https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=youremail@gmail.com&su=yoursubject&body=my-text&ui=2&tf=1&pli=1')"></a></li>
    
    0 讨论(0)
提交回复
热议问题