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

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
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top