1 JavaScript发送邮件
<script language="javascript">
function SendMail() {
document.location = "mailto:seat@wicresoft.com;?subject=Feedback";
alert("ddd");
}
</script>
2 用Office发送邮件。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Net.Mail;
using Microsoft.Office.Interop.Outlook;
using Microsoft.Office;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
Microsoft.Office.Interop.Outlook.Application outlookObj = new Microsoft.Office.Interop.Outlook.Application();
MailItem Item = (Microsoft.Office.Interop.Outlook.MailItem)outlookObj.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
Item.To = "seat@info.com";
Item.CC = "seat@info.com";
Item.Subject = "hello";
Item.Body = "hello";
Item.Send();
}
}
但是,恼人的是,用这个方法发送的话,Outlook会产生一个对话框,提醒用户有未知的应用程序正在冒充她的名义发送邮件。
大家可以去试试。如果找到回避这个警告框的方法,请告诉我,谢.