我想使用我编写/引用的以下代码从 python 发送电子邮件
<script>
$(document).ready(function() {
$("#form1").submit(function(){
$("#form1").validationEngine();
if($('div input[type=text]').val() != "")
{
var textfield2=document.getElementById("textfield2").value;
var textarea=document.getElementById("textarea").value;
var dataS=$("#form1").serialize();
$.ajax({
type: "POST",
crossDomain: 'true',
url: "mail.py",
success: function( ){
alert("completed");
},
error: function(){
alert(dataS);
}
});
}
return false;
});
});
</script>
对于邮件部分,我参考了下面的谷歌代码
from google.appengine.api import mail
mail.send_mail(sender="Example.com Support <support@example.com>",
to="Albert Johnson <Albert.Johnson@example.com>",
subject="Your account has been approved",
body="""
Dear Albert:
Your example.com account has been approved. You can now visit
http://www.example.com/ and sign in using your Google Account to
access new features.
Please let us know if you have any questions.
The example.com Team
""")
现在的问题是,在 ajax 调用.. 我怎样才能收到 mail.py 脚本中的 HTML 参数?请帮助我是python的新手