代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Asp.Net
】
net的发送邮箱
作者:
/ 发布于
2011/1/10
/
480
<div><span style="color: #0000ff">using</span><span style="color: #000000"> System; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Collections.Generic; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Linq; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Web; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Web.UI; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Web.UI.WebControls; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Net.Mail; </span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Net; </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">partial</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> _Default : System.Web.UI.Page { </span><span style="color: #0000ff">protected</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> Page_Load(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, EventArgs e) { MailAddress from </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> MailAddress(</span><span style="color: #800000">"</span><span style="color: #800000">alexyuan2010@gmail.com</span><span style="color: #800000">"</span><span style="color: #000000">,</span><span style="color: #800000">"</span><span style="color: #800000">alex</span><span style="color: #800000">"</span><span style="color: #000000">); MailAddress to </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> MailAddress(</span><span style="color: #800000">"</span><span style="color: #800000">408599029@qq.com</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800000">"</span><span style="color: #800000">alexyuan</span><span style="color: #800000">"</span><span style="color: #000000">); MailMessage mymail </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> MailMessage(to, from); mymail.Subject </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">1</span><span style="color: #800000">"</span><span style="color: #000000">; mymail.Body </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000"><a href=\</span><span style="color: #800000">"</span><span style="color: #000000">http:</span><span style="color: #008000">//</span><span style="color: #008000">www.1040baojian.com\">连接</a>";</span><span style="color: #008000"> </span><span style="color: #000000"> SmtpClient client </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> SmtpClient(</span><span style="color: #800000">"</span><span style="color: #800000">smtp.qq.com</span><span style="color: #800000">"</span><span style="color: #000000">);//需要你的邮箱开设smtp服务 client.UseDefaultCredentials </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">; client.Credentials </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> NetworkCredential(</span><span style="color: #800000">"</span><span style="color: #800000">408599029@qq.com</span><span style="color: #800000">"</span><span style="color: #000000">, </span><span style="color: #800000">"xxxx</span><span style="color: #800000">"</span><span style="color: #000000">);//添加你的邮箱的用户名和密码 client.DeliveryMethod </span><span style="color: #000000">=</span><span style="color: #000000"> SmtpDeliveryMethod.Network; mymail.IsBodyHtml </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">; client.Send(mymail); } } </span></div>
试试其它关键字
发送邮箱
同语言下
.
gzip压缩
.
实现http多线程断点续传下载文件
.
实现多线程断点续传下载大文件
.
生成字符串的 CheckSum
.
根据 UserAgent 获取浏览器的类型和版本
.
根据 Agent 判断是否是智能手机
.
隐藏手机号中间四位为*方法
.
合并图片(二维码和其他图片合并)
.
ASP.NET CORE中判断是否移动端打开网页
.
ASP.NET(C#)实现页面计时(定时)自动跳转
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
贡献的其它代码
Label
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3