Home >Web Front-end >JS Tutorial >Pure javascript to automatically send emails
Description:
This JavaScript will help you email people. Just click email and there's someone! And the JavaScript will ask you for the email address, subject, etc. and then a new email will be opened to you.
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function mailsome1(){ who=prompt("Enter recipient's email address: ","antispammer@earthling.net"); what=prompt("Enter the subject: ","none"); if (confirm("Are you sure you want to mail "+who+" with the subject of "+what+"?")==true){ parent.location.href='mailto:'+who+'?subject='+what+''; } } // End --> </SCRIPT> <a href='javascript:mailsome1()'>E-Mail Someone!</a> <FORM> <input type=button value="E-Mail Someone!" onClick="mailsome1()"> </FORM>
Okay, the above is the code to automatically send emails using javascript. The code is simple and easy to understand
For more articles related to pure javascript to automatically send emails, please pay attention to the PHP Chinese website!