用C#发送邮件的几种方法
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会产生一个对话框,提醒用户有未知的应用程序正在冒充她的名义发送邮件。
大家可以去试试。如果找到回避这个警告框的方法,请告诉我,谢.
相关文档:
TCP是连接模型,如下:
服务器连接 服务器断开
↓   ......
这个例子要把bookstore.xml文件增加一条book记录
1 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="love" ISBN="1234123">
<title>who am i </title>
<author>who</author>
  ......
接上一篇《C#写XML的简单例子》
这个例子要修改XML文件中结点的属性和和元素的文本
1 原xml文件 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="love" ISBN="1234123">
<title>who am i </title>
&l ......
接上一篇
删除原genre属性,删除leixing=love的所有结点。
1 原xml文件 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="love" ISBN="1234123">
<title>who am i </title>
<author>who</aut ......
在C#.net中如何操作XML
需要添加的命名空间:
using System.Xml;
定义几个公共对象:
XmlDocument xmldoc ;
XmlNode xmlnode ;
XmlElement xmlelem ;
1,创建到服务器同名目录下的xml文件:
方法一:
xmldoc = new XmlDocument ( ) ;
//加入XML的声明段落
xmlnode = xmldoc.CreateNode ( XmlNodeType.XmlDeclara ......