Winform 发邮件---C#
来源:互联网 发布:python交易策略 编辑:程序博客网 时间:2024/06/03 16:32
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Net.Mail;using System.Net;namespace mail{ public partial class Mail { //strReceiverMail 收件人邮箱 private void sendMail(string strReceiverMail,string strSubject,string strBody) { MailMessage msg = new MailMessage(); msg.Subject = strSubject; //标题 msg.Body = strBody; //内容 msg.From=new MailAddress("xxx@163.com"); //邮件来自哪 msg.To.Add(strReceiverMail);//收件人 SmtpClient client=new SmtpClient(); //允许传输协议 client.Host = "smtp.163.com"; //发件方服务器地址 client.Port = 25; //发件方端口 NetworkCredential credential = new NetworkCredential(); credential.UserName = "xxx@163.com"; credential.Password = "xxxxxx"; client.Credentials = credential; //说明证书要给代理证书credential Attachment att = new Attachment(this.textBox4.Text); msg.Attachments.Add(att); client.Send(msg); } }}
0 0
- Winform 发邮件---C#
- c# Winform发邮件失败,附件过大
- .NET 发邮件 Winform
- c#如何发邮件?
- C#发邮件
- C# 发邮件
- C#实现发邮件
- c#异步发邮件
- C# 发用邮件
- C# 发邮件
- C# 发邮件
- C#自动发邮件
- C#发邮件
- c# 接发邮件
- C#发邮件
- C#发邮件
- C#发邮件功能
- C#发邮件
- JFreeChart(报表图形引擎)的使用
- LeetCode108 Convert Sorted Array to Binary Search Tree
- 使用wamp、thinkphp网站建设中的一些问题
- git 查看本地分支和远程分支,创建本地分支,创建远程分支,本地分支对应的远程分支相关联
- Unity3D自制虚拟摇杆和一个方法控制多个按钮
- Winform 发邮件---C#
- QT下生成可执行程序的方法及一些问题解决办法:
- Gym
- 问题:adb server version (31) doesn't match this client
- PyQt4原始例程--下拉菜单可供选择并打印出来
- 4.28 JEE实习日记
- Python 迭代器
- 霍金GMIC演讲:AI或终结人类文明
- 我的sql效率提升经验+取经