Sending Email from console app

Posted on 2006-05-18
Last Modified: 2010-04-23
I am using a console program to tranfer data between a website and backoffice system. I am unable to get the program to send an email notice. I have tried a couple of variations on the code below:
 objMail.From = EmailFrom
            objMail.BodyFormat = MailFormat.Html
            objMail.Body = EmailBody
            1 - SmtpMail.SmtpServer.Insert(0, "")
            2 - SmtpMail.SmtpServer = "localhost"

#1 - no error but the smtpserver value is blank.
#2 - error is can't find cdo object.

Any help is welcomed.
Question by:jberv534

    Assisted Solution

    Hi there,

    I have been using this component for a while now. It works great.
    LVL 11

    Accepted Solution

    The mail component in .net uses the CDONTS mail component.  If you are using a machine which is pre windows 2000 it wont have CDONTS on it.  There are some installation instructions here...
    Make sure you specify as much info as possible for the email, depending on the smtp server settings it could be rejecting it due to the email having no subject etc, but to be honest I don't think thats the case here, I reckon the CDONTS dll is not present on the system or is corrupted / unregistered.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now