Dim objmailmessage As New MailMessage
Dim from As String
from = "web@zdsw.com"
objmailmessage.From = from
objmailmessage.To = TextBox2.Text
objmailmessage.Subject = "欢迎成为浙东商务网的会员,下面是你的登陆密码!你可以在我的办公室里修改密码!"
objmailmessage.Body = "请以" & "ID:" + TextBox1.Text + ",密码:" + strpasswd + ",登录浙东商务网"
'objmailmessage.BodyFormat = MailFormat.Html
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'如果用smtp(Server用外部的, 请您把SendUsing设为2, 内部设为1)
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = from
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname") = from
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = from
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/cdoSMTPServerPort") = 25
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "8833633"
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'value=0 代表Anonymous验证方式(不需要验证)
'value=1 代表Basic验证方式(使用basic (clear-text) authentication.
'The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
'Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/languagecode") = " 0x0804"
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "zdsw.com.cn"