CDO.Message Error

  • Thread starter Thread starter Mark Mahacek
  • Start date Start date
M

Mark Mahacek

I have copied over code to create an e-mail from a web form, but I am
getting the following error: (pathnames changed)

The following exception occurred: System.Web.HttpException: Could not create
'CDO.Message' object. at
System.Web.Mail.LateBoundAccessHelper.get_LateBoundType() at
System.Web.Mail.CdoSysHelper.Send(MailMessage message) at
System.Web.Mail.SmtpMail.Send(MailMessage message) at
www.mydomain.org.LabReserve.ComposeMail() in
C:\......\LabReserve.aspx.vb:line 87

The code is:

Dim smtpServer As String = "mail.mydomain.org"
Dim mail As MailMessage = New MailMessage
Dim body As String
mail.From = (e-mail address removed)
mail.Cc = (e-mail address removed)
mail.Subject = "Lab Reservation Request"
body = body + "Requestor: " + txtName.Text + vbLf
body = body + "EMail: " + txtEMail.Text + vbLf
body = body + "Title: " + txtTitle.Text + vbLf
body = body + "Start Date: " + calStartDate.SelectedDate.ToShortDateString +
vbLf
body = body + "" + vbLf
mail.Body = body
SmtpMail.SmtpServer = smtpServer
SmtpMail.Send(mail)


I've used this same structure in other areas and it works just fine.
 
Sounds like you do not have SMTP server installed,
It's part of Windows and installed the same way IIS is.

George.

I have copied over code to create an e-mail from a web form, but I am
getting the following error: (pathnames changed)

The following exception occurred: System.Web.HttpException: Could not create
'CDO.Message' object. at
System.Web.Mail.LateBoundAccessHelper.get_LateBoundType() at
System.Web.Mail.CdoSysHelper.Send(MailMessage message) at
System.Web.Mail.SmtpMail.Send(MailMessage message) at
www.mydomain.org.LabReserve.ComposeMail() in
C:\......\LabReserve.aspx.vb:line 87

The code is:

Dim smtpServer As String = "mail.mydomain.org"
Dim mail As MailMessage = New MailMessage
Dim body As String
mail.From = (e-mail address removed)
mail.Cc = (e-mail address removed)
mail.Subject = "Lab Reservation Request"
body = body + "Requestor: " + txtName.Text + vbLf
body = body + "EMail: " + txtEMail.Text + vbLf
body = body + "Title: " + txtTitle.Text + vbLf
body = body + "Start Date: " + calStartDate.SelectedDate.ToShortDateString +
vbLf
body = body + "" + vbLf
mail.Body = body
SmtpMail.SmtpServer = smtpServer
SmtpMail.Send(mail)


I've used this same structure in other areas and it works just fine.
 
In my actual script, I am pointing to our Exchange server. I changed the address for posting here.

--
Mark Mahacek
Merced County Office of Education


Sounds like you do not have SMTP server installed,
It's part of Windows and installed the same way IIS is.

George.

I have copied over code to create an e-mail from a web form, but I am
getting the following error: (pathnames changed)

The following exception occurred: System.Web.HttpException: Could not create
'CDO.Message' object. at
System.Web.Mail.LateBoundAccessHelper.get_LateBoundType() at
System.Web.Mail.CdoSysHelper.Send(MailMessage message) at
System.Web.Mail.SmtpMail.Send(MailMessage message) at
www.mydomain.org.LabReserve.ComposeMail() in
C:\......\LabReserve.aspx.vb:line 87

The code is:

Dim smtpServer As String = "mail.mydomain.org"
Dim mail As MailMessage = New MailMessage
Dim body As String
mail.From = (e-mail address removed)
mail.Cc = (e-mail address removed)
mail.Subject = "Lab Reservation Request"
body = body + "Requestor: " + txtName.Text + vbLf
body = body + "EMail: " + txtEMail.Text + vbLf
body = body + "Title: " + txtTitle.Text + vbLf
body = body + "Start Date: " + calStartDate.SelectedDate.ToShortDateString +
vbLf
body = body + "" + vbLf
mail.Body = body
SmtpMail.SmtpServer = smtpServer
SmtpMail.Send(mail)


I've used this same structure in other areas and it works just fine.
 
I was able to find a fix for my problem. I had to re-register cdosys.dll,
and it fixed the problem immediately.

regsvr32 %systemroot%\system32\cdosys.dll
 

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

Back
Top