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
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