ASP.NET jmial 电子邮件的发送
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
sendMail("陈建勇", "chenjianyong@126.com", "chen@126.com", "发个邮件试试", "你能收到,说明是你自己发的");
}
/// <summary>
/// 发送电子邮件 引用jmail 组件
/// </summary>
/// <param name="sender"> 发件人 </param>
/// <param name="senderMail"> 发件人电子邮件 </param>
/// <param name="receiver"> 收件人电子邮件 </param>
/// <param name="subject">主题 </param>
/// <param name="content"> 邮件内容 </param>
public void sendMail(string sender, string senderMail, string receiver, string subject, string content)
{
jmail.MessageClass jmMessage = new jmail.MessageClass();
// 设置字符集
jmMessage.Charset = "gb2312";
//设置邮件内容形式
jmMessage.ContentType = "text/html";
// 发件人邮箱地址
jmMessage.from = senderMail;
// 发件人姓名
jmMessage.fromName = sender;
// 设置主题
jmMessage.Subject = subject;
// 设置内容
相关文档:
本教程创建使用 ASP.NET 的 AJAX 功能的基本示例应用程序。您可以了解到有关 ASP.NET 的 AJAX 功能的更多信息,将知道这些功能旨在解决哪些技术问题,以及以下介绍性文档将涉及哪些重要的 AJAX 组件:
·ASP.NET AJAX Overview
·添加 AJAX 和客户端功能
在本教程中,您将 ......
前台 如果你用的是 gridview 就把Repeater替换成gridview 。一样的。。
<form id="frm01" action="" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
& ......
发布中遇到了两个问题
一。session 会短时间自动消失
解决办法
1。在www.google.com中查session 丢失
2。在Window服务中将ASP.NET State Service 启动。
3。修改web.config
<system.web>
add <sessionState mode="StateServer" timeout="60"/>
二。sql server 超过最大连接池数
......
由于用的是VPS主机,不知道啥原因SESSION总是丢失,无奈换Cookies。
查一下MSDN,在ASP.NET有两个COOKIES,Response.Cookies和Request.Cookies,无论用哪个都不行,添加进去后就读取不到
后来发现通过Response.Cookies添加、Request.Cookies读取才行。下面是添加、读取、删除的代码:
//添加
HttpCookie c = ne ......
If you come to ASP.NET MVC from a purely ASP.NET Web Forms background, one of the first things you are likely to notice is that all those nice easy Server Controls have disappeared. One of those is the FileUpload, and its absence seems to cause a few problems. This article looks at how to upload f ......