none
The server is not available. Contact your administrator if this condition persists. RRS feed

  • Question

  • C# - Winforms - Visual Studio 2005 - Outlook 2010

    I'm absoultly new to Outlook and have never had to write any email code.

    I have some sample email code that will not run because of this message:

    The server is not available. Contact your administrator if this condition persists.

    A few lines of the sample code:

    Outlook.

    Application oApp = new Outlook.Application();

    Outlook.NameSpace oNS = oApp.GetNamespace("mapi");

    oNS.Logon(

    "outlook", Missing.Value, false, true);

    Is my error here? What do I put for a Logon?

    I work out of my home but this will eventually run on a server.

    I just installed Office Home and Business 2010 and set up my personal email accounts but it is giving me errors about too many email messages (I don't need or want to use Outlook from my house, looks too complicated).

    Thanks for any help getting me stated with this,

    Dennis

     

    Tuesday, July 20, 2010 5:42 PM

Answers

  • The problem was my profile in Outlook was receiving emails okay but not sending them. I fixed the problem and everything is now working at home and at the office.

    Thanks.

    • Marked as answer by NDennisV Thursday, July 22, 2010 11:52 AM
    Thursday, July 22, 2010 11:52 AM

All replies

  • The first argument should be the name of an existing mail profile. And the last parameter is irrelevant if Outlook is already running, because only one Outlook session is possible at a time. Reference:

    Namespace.Logon method
    http://msdn.microsoft.com/en-us/library/bb219914.aspx

    You should not attempt to write code for Outlook until you have a fully functional Outlook installation. The place for help with your error messages is this forum: 

    Setting up Accounts, Mail files, and Views
    http://social.answers.microsoft.com/Forums/en-US/outlookacct/threads

    Be sure to include the *exact text* of any error messages. 

    However, fixing this won't solve your larger roadblock -- that Outlook is not suitable to automate from server-based code. Best to start thinking about other ways to do whatever it is your application is supposed to do. 

    Tuesday, July 20, 2010 6:22 PM
    Moderator
  • The problem was my profile in Outlook was receiving emails okay but not sending them. I fixed the problem and everything is now working at home and at the office.

    Thanks.

    • Marked as answer by NDennisV Thursday, July 22, 2010 11:52 AM
    Thursday, July 22, 2010 11:52 AM
  • Hi,

    Can you please share the solution to this, I am facing the same problem.

    Regards

    Bhupesh

    Monday, October 21, 2019 10:41 AM