通过Java邮件 [英] Mail through Javascript

查看:72
本文介绍了通过Java邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何使用JavaScript 发送邮件?

How can we send mail using JavaScript?

推荐答案

不可能直接进行.您必须使用服务器端语言,例如ASP.Net,并使用

It's not possible directly. You'll have to use a server side language, such as ASP.Net, and call a server side email method using AJAX. Here's a quick example using jQuery:

$.ajax({
    url: "MyController/SendMail",
    data: { recipient = "bob@someplace.com" },
    success: function(data, status) {
       alert("Mail sent");
    },
    error: function() {
       alert("Mail failed.");
    }
});

这篇关于通过Java邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆