Code equivalent for this.......Help

  • Thread starter Thread starter jayakumar
  • Start date Start date
J

jayakumar

HI,

Below is the code in vb to send mail using CDO object. I
want to do the same in VB.Net , i need to know how to sent
the authentication in vb.net "
..Item(cdoSMTPAuthenticate) = cdoBasic"




VB
-------------------------------------------------------

Dim iMsg as New CDO.Message
Dim iConf as New CDO.Configuration

Dim Flds as ADODB.Fields
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerName)
= "(e-mail address removed)"
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "username"
.Item(cdoSendPassword) = "password"
.Item(cdoURLProxyServer) = "server:80"
.Item(cdoURLProxyBypass) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With

With iMsg
Set .Configuration = iConf
.To = """User A"" <[email protected]>"
.From = """User B"" <[email protected]>"
.Subject = "Hows it going? I've attached my web
page"
.CreateMHTMLBody "http://mypage"
.AddAttachment "C:\files\mybook.doc"
.Send
End With
 
Whatever account ASP.Net is running under, that is the account that is
sending the mail. Just add that account to the SMTP Server's authenticated
operators.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.
 
Back
Top