asp.net,c#,vb,vbs,js各个语言的邮箱发送源代码
发送端以163为例
一、asp.net版 using System.Web.Mail; //命名空间引用
c#
MailMessage mail = new MailMessage();
mail.To = "shadow103@qq.com"; //接受人的邮箱
mail.from = "xxx@163.com"; //你自己的邮箱(注意qq邮箱不行)
mail.Subject = "你好帅哥"; //邮箱标题
mail.Body = "正文";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing","2")
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //stmp验证
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", 你邮箱帐号");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "你邮箱密码");
SmtpMail.SmtpServer = "smtp.163.com"; //代理邮件服务器
SmtpMail.Send(mail);
vb
Dim mail As New MailMessage()
mail.To = "shadow103@qq.com"
mail.from = "xxx@163.com"
mail.Subject = "你好帅哥"
mail.Body = "正文"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing","2")
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'stmp验证
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "你邮箱帐号")
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "你邮箱密码 ")
SmtpMail.SmtpServer = "smtp.163.com" '代理邮件服务器
SmtpMail.Send(mail)
相关文档:
在学习过程中发现如果要上传的照片很大的话,速度会很慢,所以采用了在上传照片时同时上传缩略图的方式,这样就可以既不影响多个图片的浏览,又不影响查看具体的图片。
需要用到的命名空间:
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
#region 保存上传文件,方法名:UploadSave(string ......
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <summary>
/// 返回按钮点击事件
/// </summary& ......
我想在asp中加一个链接,指向asp.net网页,但asp.net的网址是经过HttpUtility.UrlEncode变形和HttpUtility.UrlDecode变回的,而asp的server.urlencode却产生不了和HttpUtility.UrlEncode一样的编码,请问有没有解决办法
补充:原来asp.net的是"web.aspx?str="+HttpUtility.UrlEncode(str)
和HttpUtility.UrlDecode(Requ ......
1. 适当使用UpdatePanel
2. 利用WebService方法动态生成用户控件的内容,避免UpdatePanel回传造成的性能损失(ViewState)
3. ToolkitScriptManager代替ScriptManager
4. <asp:ScriptManager runat="server" ID="sm" ScriptMode="Release" EnablePartialRendering="false"
......