Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non-Functional Email Form 1

Status
Not open for further replies.

scantron

Programmer
Jul 4, 2002
27
CA
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
 
Do you have an SMTP server correctly configured on your loacl machine?

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Hi there,

I assumed I did. I'm not sure how to go about ensuring there is a proper SMTP server configured?

I appreciate your response.

Scantron
 
You may actually be better off asking that question in a forum that deals directly with the Operating System that you are using as it will be different for most.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top