Home >Web Front-end >JS Tutorial >Pure javascript to automatically send emails

Pure javascript to automatically send emails

高洛峰
高洛峰Original
2016-12-17 12:45:275690browse

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&#39;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=&#39;mailto:&#39;+who+&#39;?subject=&#39;+what+&#39;&#39;;
  }
}
// End -->
</SCRIPT>
<a href=&#39;javascript:mailsome1()&#39;>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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:js send emailNext article:js send email