Creating E-Mail From A Console App

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 = "(e-mail address removed)"
Message.From = "(e-mail address removed)"
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
 
* =?Utf-8?B?RWRC?= said:
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 = "(e-mail address removed)"
Message.From = "(e-mail address removed)"
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.

Take a look at <URL:http://www.systemwebmail.net/>.
 
Back
Top