<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();msgMail.To = "[email protected]";
msgMail.From = "[email protected]";
msgMail.Subject = "Attachment Test";msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\test.xml"));SmtpMail.Send(msgMail);Response.Write("Email was queued to disk");
%>
实验成功
//到网上查查一定可以找到答案的