标题:[讨论]邮件发送
只看楼主
梓风
Rank: 2
等 级:新手上路
威 望:4
帖 子:181
专家分:0
注 册:2006-10-22
 问题点数:0 回复次数:0 
[讨论]邮件发送

Dim Mail As Mail.SmtpMail
Dim mailMsg As New Mail.MailMessage
'收件人地址

mailMsg.To = Me.txtTo.Text
'发件人地址
mailMsg.From = "wanfangsoft@126.com"
'邮件主题

mailMsg.Subject = Me.txtSubject.Text
'邮件内容
mailMsg.Body = Me.txtContent.Text
'支持服务器验证
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
'用户名
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "wanfangsoft@126.com")
'密码
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "05732718930")
Try
Mail.SmtpServer = "smtp.126.com"
Mail.Send(mailMsg)
Me.Session.Remove("email")
Me.Session.Remove("key")
Me.Session.Remove("startdate")
Me.Session.Remove("enddate")
Me.Session.Remove("state")
Me.lblMsg.Text = "发送成功!"
Catch ex As Exception
Me.lblMsg.Text = "请关闭杀毒软件邮件监控,重新发送。"
End Try

搜索更多相关主题的帖子: 邮件 
2006-10-25 15:56



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-98659-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.045281 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved