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

  • SEARCH
  • Home
  • 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 8568071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:01:28+00:00 2026-06-11T18:01:28+00:00

In VBA I’m currently using code similar to the following to create and send

  • 0

In VBA I’m currently using code similar to the following to create and send Outlook mail items:

Function example()

Dim OutAppl As Outlook.Application
Dim my_email As Outlook.MailItem

Set OutAppl = New Outlook.Application
Set my_email = OutAppl.CreateItem(olMailItem)

    With my_email

       .Importance = 2
       .To = "me@foo.com; "
       .Subject = "not so easy in C#"
       .BodyFormat = 2   'olFormatHTML
       .HTMLBody = "<P>" & _
                  "<BR>" & _
                  "<FONT face=""Lucida Sans Unicode"" size=2.5>" & _
                         "Hello SO" & _
                         "<BR>" & _
                         "</FONT>" & _
                         "</P>" & _
                   "</BODY></HTML>"           
       .Save
       .send
     End With

Set OutAppl = Nothing
Set my_email = Nothing

End Function

Where do I start in creating something like the above using C#?
Is there an outlook interops assemply that I can reference similar to using excel?

  • 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-11T18:01:29+00:00Added an answer on June 11, 2026 at 6:01 pm

    To answer your question directly, the Outlook Interop library is just a few down from Excels in Visual Studio’s Add Reference dialogue box:

    References

    And yes it works in the same way as Excels, you instantiate an Outlook Application object, and then more or less anything you can do through VBA in Outlook, you can do by calling the application instances equivalent method in .Net.

    If you want me to add some sample code just comment and I will, but as jrummell says, why not just use System.Net.Mail?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using VBA I want to send a copy of the current word document to
I am using VBA for Microsoft Excel 2007. My code is as follows: Sub
Using VBA, how can I search for a text string, for example CHIR ,
I had some existing VBA code that was building queries using string concatenation. I
I am using VBA for Excel 2010 and randomly receiving the following error: Run-time
I put together some VBA code for Outlook 2007 which has been working predominantly
I am using VBA to alter Excel and have the following simple event handler
This is the VBA code im using to try add a new sheet to
Does VBA support using an array of range variables? dim rangeArray() as range dim
I am converting VBA code that contains the LIKE operator, as in dim sToken

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.