經STMP發送電郵 - 簡單
来源:互联网 发布:mac mini 2014 换内存 编辑:程序博客网 时间:2024/05/02 00:25
代碼如下
一個按鈕btnSend,
一個文本框txtbox
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Net.Mail; public partial class NWorkFlow_SENDTEST : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void btnSend_Click(object sender, EventArgs e) { MailAddress to = new MailAddress("XXXX@sZZZ.com"); MailAddress from = new MailAddress("XXXX@sZZZ.com"); MailMessage message = new MailMessage(from, to); message.Subject = "Using the new SMTP client."; message.Body = @"Using this new feature, you can send an e-mail message from an application very easily."; // Use the application or machine configuration to get the // host, port, and credentials. SmtpClient client = new SmtpClient(); client.Host="XXX2.sZZZ.com"; client.Port=25; client.UseDefaultCredentials = true; txtbox.Text = "Sending an e-mail message to {0} at {1} by using the SMTP host={2}."; try { client.Send(message); } catch (Exception ex) { txtbox.Text="Exception caught in CreateTestMessage3(): {0}"+ ex.ToString(); } }}
0 0
- 經STMP發送電郵 - 簡單
- stmp mail
- stmp config
- cmd stmp
- pop3,stmp,imap协议
- stmp邮箱发送
- 各个stmp的地址
- stmp明文认证问题
- email stmp exception
- 邮件发送协议 stmp
- stmp 邮件发送
- 使用stmp发送邮件
- C#-Stmp发邮件
- php stmp邮件发送
- stmp邮件协议讲解
- play framework学习(stmp)
- POP3、IMAP 和 STMP 区别
- 持stmp认证、HTML格式邮件
- 获取状态栏高度工具类
- 布局
- Eddystone简要介绍
- nasm : 堆栈平衡的函数调用
- 一种将通讯录和即时通讯软件整合的方法及装置
- 經STMP發送電郵 - 簡單
- windows平台MingW环境下编译FFMPEG及X264
- 1588: [HNOI2002]营业额统计(Splay树入门)
- WebRTC VideoEngine超详细教程(一)——视频通话的基本流程
- debian repertory && source.list
- hdu 3038D - How Many Answers Are Wrong [kuangbin带你飞]专题五 并查集
- win32 socket编程 示例(功能简单,完善)
- Maximum Depth of Binary Tree
- 深入理解Spark Streaming执行模型