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
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
You can add a new line with %0a
instead of \n
for gmail and some other email clients.
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>