CDO.message error

D

Denis Correard

I'm trying to create a page that automaticaly send email.

I'm using the system.web.mail namespace but from time to time i'm getting
this error: Could not access 'CDO.Message' object.

Same time it work and same time it does not work. Any idear?

This is the code i'm using:

Dim mvarMailServer As Mail.SmtpMail
mvarMailServer.SmtpServer = TxtSMTPMail.Text


Dim objMail2 As New Mail.MailMessage
With objMail2
.From = TxtFrom.Text
.To = TxtTo.Text
.Cc = TxtCC.Text
.BodyFormat = Mail.MailFormat.Html
.Subject = TxtSubject.Text

.Body = TxtBody.Text
.Priority = Mail.MailPriority.High
End With

Try
mvarMailServer.Send(objMail2)
Me.LblResult.Text = "Sent"
Catch ex As Exception
Me.LblResult.Text = "not Sent"
TxtBody.Text = ex.Message
End Try


objMail2 = Nothing

mvarMailServer = Nothing
 

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
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top