Re: Send Mail using CDO object in vb.net

J

jayakumar

cdoMail.MimeFormatted = True
cdoMail.CC = strCCmail
cdoMail.Subject = strsubject
cdoMail.From = strFromEmail
cdoMail.HTMLBody = strBody
cdoMail.Send()
' Set the configuration for Network Send
Flds(cdoSendUsingMethod) = cdoSendUsingPort

Flds(cdoSMTPAuthenticate) = cdoBasic

Flds(cdoSMTPServer) = SMTP_SERVER_NAME
Flds(cdoSMTPServerPort) = SMTP_PORT

Flds(cdoSendUserName) = SMTP_USER_NAME
Flds(cdoSendPassword) = SMTP_PASSWORD
Flds.Update
 
T

Tom Spink

How about using the System.Web.Mail namespace?

You need to Add a reference to System.Web in your project (unless it's a web
project)

Then...

Imports System.Web.Mail
..
..
..
Dim mmEmail As New MailMessage()

With mmEmail
.CC = strCCmail
.Subject = strSubject
.From = strFromEmail
.BodyFormat = MailFormat.Html
.Body = strBody
End With

SmtpMail.SmtpServer = SMTP_SERVER_NAME
SmtpMail.Send(mmEmail)

--
Happy to help,
-- Tom Spink
([email protected])

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
 
J

jayakumar

Thanks Tom,

But my smtp server require authentication, can u tell
how do i set the username password so that i can use
system.web.mail.

thanks
 

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

Top