PC Review


Reply
Thread Tools Rate Thread

Creating E-Mail From A Console App

 
 
=?Utf-8?B?RWRC?=
Guest
Posts: n/a
 
      3rd Aug 2004
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 Removed)"
Message.From = "(E-Mail 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
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      3rd Aug 2004
* =?Utf-8?B?RWRC?= <(E-Mail Removed)> scripsit:
> 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 Removed)"
> Message.From = "(E-Mail 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/>.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a 'console application' Marco Shaw Microsoft C# .NET 3 30th Dec 2006 01:10 PM
Creating an App that runs as both Console and GUI Lobsterpants@gmail.com Microsoft C# .NET 3 12th Aug 2005 01:47 PM
Creating an MSC console =?Utf-8?B?UmljaGFyZCBXZWxjaA==?= Microsoft Dot NET 0 10th Jun 2005 08:06 PM
Re: Creating web applications NOT via IIS console Phil Winstanley [Microsoft MVP ASP.NET] Microsoft ASP .NET 0 15th Jun 2004 02:57 PM
Creating log files from Console App Rathtap Microsoft C# .NET 1 12th Nov 2003 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:43 PM.