简单邮件发送程序
client = new SmtpClient();
client.Host = "smtp.邮箱服务器
client.UseDefaultCredentials = false;
client.Credentials = new ("你自己邮箱", "**********");
client.DeliveryMethod =
message = new MailMessage("你自己邮箱", "要发送的邮件地址");
message.Subject = "图片";
message.Body = "一张图片";
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
message.Attachments.Add(new Attachment("e:\\a.jpg"));//附件
try
{
client.Send(message);
MessageBox.Show("Email发送成功");
}
catch (Exception ex)
{
MessageBox.Show("Email发送失败的原因 是" + ex.ToString());
}