Try to send email
-
I'm trying to send email from within VB.NET and I get the following error: "Could not access 'CDO.Message' object." when I try to send the message. Here's a brief summary of my config: Running Windows 2000, SP3 on our Company Ethernet with MS Echange email server Code:
Imports System.Web.Mail 'These 3 were added while I was debugging the problem, but they don't seem to help Imports CDO Imports MAPI Imports MSMAPI . . Dim MailMsg As System.Web.Mail.MailMessage Dim MailSrvr As System.Web.Mail.SmtpMail . . . . MailMsg = New System.Web.Mail.MailMessage() MailMsg.From = "from@email" MailMsg.Body = "Test Message!" MailMsg.Subject = "HI" MailMsg.To = "to@email" Try MailSrvr.Send(MailMsg) Catch err As Exception Debug.WriteLine(err.Message) End Try
Without fail, I get the error message. It seems to me that the code is right, but I must be missing a service or config somewhere. I've searched high and low on the web, MSDN, and .NET's sorry documentation but can't find out what's up. Any ideas? -
I'm trying to send email from within VB.NET and I get the following error: "Could not access 'CDO.Message' object." when I try to send the message. Here's a brief summary of my config: Running Windows 2000, SP3 on our Company Ethernet with MS Echange email server Code:
Imports System.Web.Mail 'These 3 were added while I was debugging the problem, but they don't seem to help Imports CDO Imports MAPI Imports MSMAPI . . Dim MailMsg As System.Web.Mail.MailMessage Dim MailSrvr As System.Web.Mail.SmtpMail . . . . MailMsg = New System.Web.Mail.MailMessage() MailMsg.From = "from@email" MailMsg.Body = "Test Message!" MailMsg.Subject = "HI" MailMsg.To = "to@email" Try MailSrvr.Send(MailMsg) Catch err As Exception Debug.WriteLine(err.Message) End Try
Without fail, I get the error message. It seems to me that the code is right, but I must be missing a service or config somewhere. I've searched high and low on the web, MSDN, and .NET's sorry documentation but can't find out what's up. Any ideas?Have you set the
MailSrvr.SmtpServer
property yet??. You need to set it to the IP of your Mail Server. Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain -
Have you set the
MailSrvr.SmtpServer
property yet??. You need to set it to the IP of your Mail Server. Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain