最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Email发送完全手册
时间:2022-07-02 11:34:01 编辑:袖梨 来源:一聚教程网
1.用asp+发送简单的Mail
<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Util" %>
<%
string strTo = "[email protected]";
string strFrom = "[email protected]";
string strSubject = "asp发送mail简单例子";
SmtpMail.Send(strFrom, strTo, strSubject,"这仅仅是个简单的文本mail");
Response.Write("Email 已经发送成功");
%>
2.asp+发送HTML 格式的mail
请注意,这里用了另外的一种发送命令
<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Util" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = "[email protected]";
msgMail.Cc = "[email protected]";
msgMail.From = "[email protected]";
msgMail.Subject = "asp+发送HTML 格式的mail";
msgMail.BodyFormat = MailFormat.Html;
string strBody = "Hello World" +
" ASP+";
msgMail.Body = strBody;
SmtpMail.Send(msgMail);
Response.Write("Email 已经发送成功");
%>
3.asp+ 发送带有 附件的Email
<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Util" %>
<%
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: empdoufu.txt"));
SmtpMail.Send(msgMail);
Response.Write("Email 已经发送成功");
%>
好了,看完这篇文章以后,您是不是对于Email发送在asp+中的操作已经没有问题了?哦!还有
问题,没有关系,随时留意本站的更新吧!
<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Util" %>
<%
string strTo = "[email protected]";
string strFrom = "[email protected]";
string strSubject = "asp发送mail简单例子";
SmtpMail.Send(strFrom, strTo, strSubject,"这仅仅是个简单的文本mail");
Response.Write("Email 已经发送成功");
%>
2.asp+发送HTML 格式的mail
请注意,这里用了另外的一种发送命令
<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Util" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = "[email protected]";
msgMail.Cc = "[email protected]";
msgMail.From = "[email protected]";
msgMail.Subject = "asp+发送HTML 格式的mail";
msgMail.BodyFormat = MailFormat.Html;
string strBody = "Hello World" +
" ASP+";
msgMail.Body = strBody;
SmtpMail.Send(msgMail);
Response.Write("Email 已经发送成功");
%>
3.asp+ 发送带有 附件的Email
<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Util" %>
<%
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: empdoufu.txt"));
SmtpMail.Send(msgMail);
Response.Write("Email 已经发送成功");
%>
好了,看完这篇文章以后,您是不是对于Email发送在asp+中的操作已经没有问题了?哦!还有
问题,没有关系,随时留意本站的更新吧!
相关文章
- 《无限暖暖》天星之羽获得位置介绍 12-20
- 《流放之路2》重铸台解锁方法介绍 12-20
- 《无限暖暖》瞄准那个亮亮的成就怎么做 12-20
- 《无限暖暖》魔气怪终结者完成方法 12-20
- 《无限暖暖》曙光毛团获得位置介绍 12-20
- 《无限暖暖》日光果获得位置介绍 12-20