Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim MailMsg As New Mail.MailMessage
Dim MailAttach As Mail.MailAttachment
MailMsg.From = "hm_jg@yahoo.com.cn"'发件人邮件
MailMsg.To = "hm_jg@yahoo.com.cn"’收件人邮件
MailMsg.Cc = "hm_jg@yahoo.com.cn"‘复制人邮件
MailMsg.Subject = "怎么样发邮件到lotus"’主题
MailMsg.Body = "怎么样发邮件到lotus"‘邮件内容
'' 如果需要验证检验
''验证方式,0为匿名不需要验证,1为basic (clear text)验证方式,2为NTLM验证方式
'MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
''// SMTP账户名称
'MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpaccountname", "luqingfei@126.com")
''// 验证用户名
'MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", Me.txt_username.Text)
''// 验证密码
'MailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", Me.txt_password.Text)
Try
mail.SmtpMail.SmtpServer = "172.23.195.49"‘mail服务器地址
mail.SmtpMail.Send(MailMsg)
Me.Label2.Text = "发送成功!!"
Catch ex As Exception
Me.Label2.Text = ex.Message
End Try
End Sub
posted on 2005-09-20 16:18
飘叶 阅读(229)
评论(1) 编辑 收藏 所属分类:
经典人生