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)
相关文档:
在ASP.NET出现错误时,应该先检查ASP.NET环境是否正确搭建,比如以下几个方面:
1、是否安装相应版本的.NET Framework程序,并打好了补丁。
2、IIS是否安装运行正常,站点路径及ASP.NET版本是否配置正确。
3、在IIS WEB服务扩展中,是否允许了ASP.NET扩展。
4、是否有安全防护软件禁止向Windows和Temp文件夹写入文 ......
ASP.NET 2.0
文件1: Deafault.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&l ......
App 对象是VB应用程序的全局信息,如应用程序的标题、版本信息、可执行文件和帮助文件的路径及名称以及是否运行前一个应用程序的示例。
属性
------- 其他属性-----------------
EXEName 属性 返回当前正运行的可执行文件 ......
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1 ......
新建一个默认的ASP.NET MVC2应用程序,系统会默认的生成包含基本功能的应用程序,查看这些生成的代码,可帮助我们理解ASP.NET MVC2。下面是对URL路由的理解,以备忘。
一、Global.asax.cs中的代码:
public class MvcApplication : System.Web.HttpApplication
{
&n ......