制作客户端邮件发送系统(winform版)
2013-01-11 11:55
190 查看
--------Form1后台-------------------
private void btnSend_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.Body = this.txtBody.Text;
msg.Subject = this.txtSubject.Text;
msg.From = new MailAddress("邮箱详细账号");
msg.To.Add(this.txtMailAddress.Text);
msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Host = "smtp.qq.com";
client.Port = 25;
NetworkCredential credetial = new NetworkCredential();
credetial.UserName = "@之前的部分";
credetial.Password = "邮箱密码";
client.Credentials = credetial;
Attachment att = new Attachment(this.txtFuJian.Text);
msg.Attachments.Add(att);
client.Send(msg);
MessageBox.Show("邮件发送成功");
}
private void btnTianJia_Click(object sender, EventArgs e)
{
if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.txtFuJian.Text = this.openFileDialog1.FileName;
}
}
private void btnSend_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.Body = this.txtBody.Text;
msg.Subject = this.txtSubject.Text;
msg.From = new MailAddress("邮箱详细账号");
msg.To.Add(this.txtMailAddress.Text);
msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Host = "smtp.qq.com";
client.Port = 25;
NetworkCredential credetial = new NetworkCredential();
credetial.UserName = "@之前的部分";
credetial.Password = "邮箱密码";
client.Credentials = credetial;
Attachment att = new Attachment(this.txtFuJian.Text);
msg.Attachments.Add(att);
client.Send(msg);
MessageBox.Show("邮件发送成功");
}
private void btnTianJia_Click(object sender, EventArgs e)
{
if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.txtFuJian.Text = this.openFileDialog1.FileName;
}
}
相关文章推荐
- 制作客户端邮件发送系统(winform版)
- 1.制作客户端邮件发送系统(winform版)实现用户注册时,向其油箱发送激活码邮件,并进行状态处理。
- 简单的客户端邮件发送系统(winform版)
- 简单的客户端邮件发送系统(winform版) .
- [C#] Winform里调用系统里默认的邮件客户端
- 调用系统邮箱客户端发送邮件到指定邮箱
- unixware7.13 下自己制作邮件发送客户端
- Android使用系统内置邮件发送邮件
- PHP 邮件发送系统
- LINUX系统发送邮件的方法
- ios如何利用系统邮件发送反馈 代码
- 常见网站系统后台配置smtp发送邮件
- Java 邮件发送系统 -- JAVA 进阶
- 关于javaMail邮件发送系统
- Android发送系统邮件
- 提交订单系统自动发送邮件到收件人邮箱优化(邮件内容信息以月为单位)
- Odoo 邮件系统设置 Odoo 邮件发送失败源代码分析
- 邮件附件批量发送系统二使用手册
- ActiveMQ的测试-邮件发送系统的应用01
- 系统中没有邮件客户端设置autoLink=email会挂掉的问题