发送邮件 的类 C# .net

 /// <summary>
        /// 发送邮件
        /// </summary>
        /// <param name="SendTo">发送人的地址</param>
        /// <param name="MyEmail">我的Email地址</param>
        /// <param name="SendTitle">发送标题</param>
        /// <param name="SendBody">发送的内容</param>
        /// <param name="SendShowName">我的Email登录名</param>
        /// <param name="MyEmailPassWord">我的Email密码</param>
        /// <param name="MyEmailSmtp">Smtp邮件服务器</param>
        /// <param name="FilePath">附件地址</param>
        private void SendEmail(string SendTo, string MyEmail, string SendTitle, string SendBody, string SendShowName, string MyEmailPassWord,string FilePath, string MyEmailSmtp)
        {


            MailMessage mailObj = new MailMessage();
            mailObj.From = new MailAddress(MyEmail);//"发送邮箱地址"
            mailObj.To.Add(SendTo);//"接收邮箱地址"
            mailObj.Subject = SendTitle;// "主题"
            mailObj.Body = SendBody;// "内容"
            mailObj.Attachments.Add(new Attachment(FilePath));
            mailObj.IsBodyHtml = true;

            SmtpClient smtp = new SmtpClient();
            smtp.Host = MyEmailSmtp;// "邮件服务器地址"

            smtp.UseDefaultCredentials = true;
            smtp.Credentials = new NetworkCredential(SendShowName, MyEmailPassWord);//"登录用户名","登录密码"

            smtp.Send(mailObj);
            MessageBox.Show("发送成功");

        } 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389230.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

简明易懂的c#入门指南_统计假设检验的简明指南

简明易懂的c#入门指南介绍 (Introduction) One of the main applications of frequentist statistics is the comparison of sample means and variances between one or more groups, known as statistical hypothesis testing. A statistic is a summarized/compressed proba…

计算机科学期刊_成为数据科学家的五种科学期刊

计算机科学期刊The field of data science is advancing at an incredible pace. New scientific articles are published daily. As a student, I try to stay up-to-date with the scientific literature that is published. In this blog post, I created a list of scienti…

Torch.distributed.elastic 关于 pytorch 不稳定

错误日志&#xff1a; Epoch: [229] Total time: 0:17:21 Test: [ 0/49] eta: 0:05:00 loss: 1.7994 (1.7994) acc1: 78.0822 (78.0822) acc5: 95.2055 (95.2055) time: 6.1368 data: 5.9411 max mem: 10624 WARNING:torch.distributed.elastic.agent.server.api:Rec…

0x22 迭代加深

poj2248 真是个新套路。还有套路剪枝...大到小和判重 #include<cstdio> #include<iostream> #include<cstring> #include<cstdlib> #include<algorithm> #include<cmath> #include<bitset> using namespace std;int n,D,x[110];bool…

云原生全球最大峰会之一KubeCon首登中国 Kubernetes将如何再演进?

雷锋网消息&#xff0c;11月14日&#xff0c;由CNCF发起的云原生领域全球最大的峰会之一KubeConCloudNativeCon首次登陆中国&#xff0c;中国已经成为云原生领域一股强大力量&#xff0c;并且还在不断成长。 毫无疑问&#xff0c;Kubernetes已经成为容器编排事实标准&#xff…

分布分析和分组分析_如何通过群组分析对用户进行分组并获得可行的见解

分布分析和分组分析数据分析 (DATA ANALYSIS) Being a regular at a restaurant is great.乙 eing定期在餐厅是伟大的。 When I started university, my dad told me I should find a restaurant I really liked and eat there every month with some friends. Becoming a reg…

python 工具箱_Python交易工具箱:通过指标子图增强图表

python 工具箱交易工具箱 (trading-toolbox) After a several months-long hiatus, I can finally resume posting to the Trading Toolbox Series. We started this series by learning how to plot indicators (specifically: moving averages) on the top of a price chart.…

PDA端的数据库一般采用的是sqlce数据库

PDA端的数据库一般采用的是sqlce数据库,这样与PC端的sql2000中的数据同步就变成了一个问题,如在PDA端处理,PDA端的内存,CPU等都是一个制约因素,其次他们的一个连接稳定及其间的数据传输也是一个难点.本例中通过在PC端的转化后再复制到PDA上面,这样,上面所有的问题都得到了一个有…

bzoj 1016 [JSOI2008]最小生成树计数——matrix tree(相同权值的边为阶段缩点)(码力)...

题目&#xff1a;https://www.lydsy.com/JudgeOnline/problem.php?id1016 就是缩点&#xff0c;每次相同权值的边构成的联通块求一下matrix tree。注意gauss里的编号应该是从1到...的连续的。 学习了一个TJ。用了vector。自己曾写过一个只能过样例的。都放上来吧。 路径压缩的…

区块链的模型结构

关于区块链的模型结构问题&#xff0c;行业内已经谈论千万遍了&#xff0c;基本上已经成为一种定义式的问题了。总体上来看&#xff0c;区块链的基础架构可以分为六层&#xff0c;包括数据层、网络层、共识层、激励层、合约层、应用层。每一层分别完成一项核心的功能&#xff0…

数据科学家 数据工程师_数据科学家应该对数据进行版本控制的4个理由

数据科学家 数据工程师While working in a software project it is very common and, in fact, a standard to start right away versioning code, and the benefits are already pretty obvious for the software community: it tracks every modification of the code in a p…

JDK 下载相关资料

所有版本JDK下载地址&#xff1a; http://www.oracle.com/technetwork/java/archive-139210.html 下载账户密码&#xff1a; 2696671285qq.com Oracle123 转载于:https://www.cnblogs.com/bg7c/p/9277729.html

商米

2019独角兽企业重金招聘Python工程师标准>>> 今天看了一下商米的官网&#xff0c;发现他家的东西还真的是不错。有钱了&#xff0c;想去体验一下。 如果我妹妹还有开便利店的话&#xff0c;我会推荐他用这个。小巧便捷&#xff0c;非常方便。 转载于:https://my.osc…

C#生成安装文件后自动附加数据库的思路跟算法

using System; using System.Collections.Generic; using System.Windows.Forms; using System.Data.SqlClient; using System.Data; using System.ServiceProcess; namespace AdminZJC.DataBaseControl { /// <summary> /// 数据库操作控制类 /// </summary> …

python交互式和文件式_使用Python创建和自动化交互式仪表盘

python交互式和文件式In this tutorial, I will be creating an automated, interactive dashboard of Texas COVID-19 case count by county using python with the help of selenium, pandas, dash, and plotly. I am assuming the reader has some familiarity with python,…

不可不说的Java“锁”事

2019独角兽企业重金招聘Python工程师标准>>> 前言 Java提供了种类丰富的锁&#xff0c;每种锁因其特性的不同&#xff0c;在适当的场景下能够展现出非常高的效率。本文旨在对锁相关源码&#xff08;本文中的源码来自JDK 8&#xff09;、使用场景进行举例&#xff0c…

数据可视化 信息可视化_可视化数据以帮助清理数据

数据可视化 信息可视化The role of a data scientists involves retrieving hidden relationships between massive amounts of structured or unstructured data in the aim to reach or adjust certain business criteria. In recent times this role’s importance has been…

VS2005 ASP.NET2.0安装项目的制作(包括数据库创建、站点创建、IIS属性修改、Web.Config文件修改)

站点&#xff1a; 如果新建默认的Web安装项目&#xff0c;那它将创建的默认网站下的一个虚拟应用程序目录而不是一个新的站点。故我们只有创建新的安装项目&#xff0c;而不是Web安装项目。然后通过安装类进行自定义操作&#xff0c;创建新站如下图&#xff1a; 2、创建新的安项…

docker的基本命令

docker的三大核心&#xff1a;仓库(repository),镜像(image),容器(container)三者相互转换。 1、镜像(image) 镜像&#xff1a;组成docker容器的基础.类似安装系统的镜像 docker pull tomcat 通过pull来下载tomcat docker push XXXX 通过push的方式发布镜像 2、容器(container)…

seaborn添加数据标签_常见Seaborn图的数据标签快速指南

seaborn添加数据标签In the course of my data exploration adventures, I find myself looking at such plots (below), which is great for observing trend but it makes it difficult to make out where and what each data point is.在进行数据探索的过程中&#xff0c;我…