本文实例为大家分享了C# Email发送邮件的具体代码,供大家参考,具体内容如下
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinUI.BAS
{
public partial class sendMail : Form
{
public sendMail()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
//回执地址
var Receipt = "****@163.com";
//实例化两个必要的
MailMessage mail = new MailMessage();
SmtpClient smtp = new SmtpClient();
//发送邮箱地址