By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,327 Members | 1,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,327 IT Pros & Developers. It's quick & easy.

E-Mailing From A Console App

P: n/a
EdB
I have the following Code in a Windows App (reference to System.Web.dll)

Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
Dim smtpmail As System.Web.Mail.SmtpMail
smtpmail.SmtpServer = "129.41.70.10"

'strOrderInfo = BuildBody()

Message.To = "ed****@beavex.com"
Message.From = "te**@beavex.com"
Message.Body = "Testing"
Message.Subject = "Hope This Works"

Try
smtpmail.Send(Message)
Catch ex As Exception
Dim s As String = ex.Message
End Try

It works fine in a Windows App. In My ConsoleApp, I'm catching an error

_message "Could not access 'CDO.Message' object." String

Any help here. The code is the exact same.

Ed
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
EdB
Sorry for the double post....the forum informed me that the first one failed.

"EdB" wrote:
I have the following Code in a Windows App (reference to System.Web.dll)

Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
Dim smtpmail As System.Web.Mail.SmtpMail
smtpmail.SmtpServer = "129.41.70.10"

'strOrderInfo = BuildBody()

Message.To = "ed****@beavex.com"
Message.From = "te**@beavex.com"
Message.Body = "Testing"
Message.Subject = "Hope This Works"

Try
smtpmail.Send(Message)
Catch ex As Exception
Dim s As String = ex.Message
End Try

It works fine in a Windows App. In My ConsoleApp, I'm catching an error

_message "Could not access 'CDO.Message' object." String

Any help here. The code is the exact same.

Ed

Nov 20 '05 #2

P: n/a
Hi Ed,

Google is full of answers to the dreaded 'cdo message object'. I've got to
think that the .net framework has a bug or 2 here, but I've found that I
overcome this error in a console app using localhost as 127.0.0.1 instead as
the smtpserver.

HTH,

Bernie Yaeger

"EdB" <Ed*@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
I have the following Code in a Windows App (reference to System.Web.dll)

Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() Dim smtpmail As System.Web.Mail.SmtpMail
smtpmail.SmtpServer = "129.41.70.10"

'strOrderInfo = BuildBody()

Message.To = "ed****@beavex.com"
Message.From = "te**@beavex.com"
Message.Body = "Testing"
Message.Subject = "Hope This Works"

Try
smtpmail.Send(Message)
Catch ex As Exception
Dim s As String = ex.Message
End Try

It works fine in a Windows App. In My ConsoleApp, I'm catching an error

_message "Could not access 'CDO.Message' object." String

Any help here. The code is the exact same.

Ed

Nov 20 '05 #3

P: n/a
EdB
Thanks, but not for me, I still have the same error.

"Bernie Yaeger" wrote:
Hi Ed,

Google is full of answers to the dreaded 'cdo message object'. I've got to
think that the .net framework has a bug or 2 here, but I've found that I
overcome this error in a console app using localhost as 127.0.0.1 instead as
the smtpserver.

HTH,

Bernie Yaeger

"EdB" <Ed*@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
I have the following Code in a Windows App (reference to System.Web.dll)

Dim Message As System.Web.Mail.MailMessage = New

System.Web.Mail.MailMessage()
Dim smtpmail As System.Web.Mail.SmtpMail
smtpmail.SmtpServer = "129.41.70.10"

'strOrderInfo = BuildBody()

Message.To = "ed****@beavex.com"
Message.From = "te**@beavex.com"
Message.Body = "Testing"
Message.Subject = "Hope This Works"

Try
smtpmail.Send(Message)
Catch ex As Exception
Dim s As String = ex.Message
End Try

It works fine in a Windows App. In My ConsoleApp, I'm catching an error

_message "Could not access 'CDO.Message' object." String

Any help here. The code is the exact same.

Ed


Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.