Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8303441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:32:36+00:00 2026-06-08T17:32:36+00:00

I am writing a project in asp.net C# using Visual Studio 2010. I want

  • 0

I am writing a project in asp.net C# using Visual Studio 2010.
I want to write function, which opens outlook window to send email when user clicks a button.

I tried this:

using Outlook = Microsoft.Office.Interop.Outlook;

Outlook.Application oApp    = new Outlook.Application ();
Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem ( Outlook.OlItemType.olMailItem );
oMailItem.To    = address;
// body, bcc etc...
oMailItem.Display ( true );

But compiler says there is no namespace Office inside namespace Microsoft.
Actually Microsoft Office including Outlook fully installed in my computer.

Should I include Office library to Visual Studio?
How the problem can be solved?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:32:37+00:00Added an answer on June 8, 2026 at 5:32 pm

    If you use Microsoft.Office.Interop.Outlook, Outlook must be installed on the server (and runs on the server, not on user computer).

    Have you tried using SmtpClient?

     System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage();
            using (m)
            {
                //sender is set in web.config:   <smtp from="my alias &lt;mymail@mysite.com&gt;">
                m.To.Add(to);
                if (!string.IsNullOrEmpty(cc))
                    m.CC.Add(cc);
                m.Subject = subject;
                m.Body = body;
                m.IsBodyHtml = isBodyHtml;
                if (!string.IsNullOrEmpty(attachmentName))
                    m.Attachments.Add(new System.Net.Mail.Attachment(attachmentFile, attachmentName));
    
                System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
                try
                { client.Send(m); }
                catch (System.Net.Mail.SmtpException) {/*errors can happen*/ }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an ASP.NET web application using Visual Studio 2008. The project is
I'm writing service which will use for sending emails in my ASP.NET project. I
I am writing project in asp.net C#. I want to create Image programmatically by
I have a multi-project ASP.NET + C# solution. I was planning on writing a
I'm using asp.NET MVC 2 for my current project and I need to validate
I'm currently using jqGrid and ASP.Net MVC. With my current project, my goal is
I am working on an ASP.NET MVC project which allows users to construct arbitrarily
Using: ASP.NET 4, SQL 2008, C# I'm writing a web app for our projects
I am writing a simple proof-of-concept web service using ASP.NET MVC3 controller with JSON
I'm writing a MVC web app in ASP.NET MVC, which is supposed to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.