Hi there,
I am creating my first asp.net email form from an online tutorial and when I try to send an email from the form I created, I get this error message:
Could not access 'CDO.Message' object
message: Anyone know what this message means or how I can avoid it?
here's the code used:
Sub Button1_Click(sender As Object, e As EventArgs)
Try
' Build a MailMessage
Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
mailMessage.From = TextBox2.Text
mailMessage.To = TextBox1.Text
mailMessage.subject = TextBox3.Text
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text
mailMessage.Body = TextBox4.Text
System.Web.Mail.SmtpMail.SmtpServer = "localhost"
System.Web.Mail.SmtpMail.Send(mailMessage)
Label2.Text = "Your Mail was sent."
Catch exp as Exception
Label2.Text = "There was and error Sending the mail: " & exp.Message
End Try
End Sub
Thank you for your help!
Scantron
I am creating my first asp.net email form from an online tutorial and when I try to send an email from the form I created, I get this error message:
Could not access 'CDO.Message' object
message: Anyone know what this message means or how I can avoid it?
here's the code used:
Sub Button1_Click(sender As Object, e As EventArgs)
Try
' Build a MailMessage
Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
mailMessage.From = TextBox2.Text
mailMessage.To = TextBox1.Text
mailMessage.subject = TextBox3.Text
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text
mailMessage.Body = TextBox4.Text
System.Web.Mail.SmtpMail.SmtpServer = "localhost"
System.Web.Mail.SmtpMail.Send(mailMessage)
Label2.Text = "Your Mail was sent."
Catch exp as Exception
Label2.Text = "There was and error Sending the mail: " & exp.Message
End Try
End Sub
Thank you for your help!
Scantron