每次加载页面时我都需要发送电子邮件(静默)。 我尝试了下面的代码:当页面加载时发送悄悄电子邮件
<html>
<head>
<script language="javascript" type="text/javascript">
var email = "[email protected]"
var subject = "test"
var body = "Hello world"
document.write("<form name="form" action=\"mailto:"+ email +"\?subject="+ subject +"\&body="+ body +"\" method=\"post\" enctype=\"text/plain\"></form>")
</script>
</head>
<body onload="document.form.submit()">
</body>
</html>
这对我不起作用!我究竟做错了什么? tnx
JavaScript不能发送邮件。服务器端可以,这是更好的,因为用户不能看到电子邮件的内容(除非他们是收件人)。看到这里http://www.w3schools.com/php/php_mail.asp – Mattios550 2013-05-01 06:50:12