發送郵件 的類 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.pswp.cn/news/389230.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389230.shtml
英文地址,請注明出處:http://en.pswp.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;我…