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 8305361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:06:03+00:00 2026-06-08T18:06:03+00:00

I am having troubles sending email with embedded image. I tried some solutions using

  • 0

I am having troubles sending email with embedded image. I tried some solutions using word editor but they can’t solve my circumstances. I can’t use SmtpClient becuase a client does not want it. He has exchange and needs to have sent email in sent folder.

I want send an email in html format with eg. image in header – logo and image in footer – sign.

I have and HTML template stored in database as string to provide more looks and purposes of an email. Specific data I insert using variables which are replaced in moment of sending.

Does anyone know how to add image stored in database to email into without using mailitem.wordeditor and without need to display inspector? Let’s assume the images are already on disc or can be a stream somehow used?

My application needs send in background without notify the user by another windows. Adding images using wordeditor needs to have inspector displayed. And even when I immediately close it, it blinks.

The second trouble is how to format HTMLBody property of mailitem, when it does not accept normal HTML but only their so-called html. Is it really needed to study their word html?

Firstly I used MailMessage and this template worked even with images and alternativeviews. Maybe exist some posibility to use MailMessage to send it via outlook, but I dont know it.

Does anoyne came accross with it?

    public void SendEmailViaOutlook()
    {
        //in template I mostly need to use table and css to divide email into blocks - header, content, footer

        String htmlTemplate = "<html>\n";
        htmlTemplate += "  <head>\n";
        htmlTemplate += "    <style type=\"text//css\">\n";
        htmlTemplate += "       #Header  {border-width: 1; border: solid; text-align: center}\n";
        htmlTemplate += "       #Content {border-width: 1; border: solid; text-align: center}\n";
        htmlTemplate += "       #Footer   {border-width: 1; border: solid; text-align: center}\n";
        htmlTemplate += "    </style>\n";
        htmlTemplate += "  </head>\n";
        htmlTemplate += "  <body>\n";
        htmlTemplate += "    <table>\n";
        htmlTemplate += "      <tr><td><img src=\"cid:companylogo\"/></td></tr>\n";
        htmlTemplate += "      <tr><td><div id=\"Header\">$HEADER$</div></td></tr>\n";
        htmlTemplate += "      <tr><td><div id=\"Contentr\">$CONTENT$</div></td></tr>\n";
        htmlTemplate += "      <tr><td><div id=\"Footer\">$FOOTER$</div></td></tr>\n";
        htmlTemplate += "      <tr><td><img src=\"cid:usersign\"/></td></tr>\n";
        htmlTemplate += "    </table>\n";
        htmlTemplate += "  </body>n";
        htmlTemplate += "</html>\n";

        //the code is simplified to demostrate problem
        //$CONTENT etc. will be replaced by another html from custom html wysiwyg editor

        try
        {
            Outlook.Application outlook = new Outlook.Application();
            Outlook._MailItem outLookMailMessage = outlook.CreateItem(Outlook.OlItemType.olMailItem) as Outlook._MailItem;
            outLookMailMessage.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;

            /*

            here a I have problem to set the property - my template is not
            set and a blank email is sent - almost none html it takes except the example from msdn http://support.microsoft.com/kb/310262, are there some rules how to write it?

            */

            outLookMailMessage.HTMLBody = htmlTemplate;
            outLookMailMessage.Subject = this.Subject;

            outLookMailMessage.Recipients.Add("somenone@somewhere.com");

            /*
             here I woud need somehow link 2 images with cid companylogo and usersign
             */

            outLookMailMessage.Send();
            outLookMailMessage = null;
        }
        catch (System.Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

Any help would be much appreciated!

  • 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-08T18:06:04+00:00Added an answer on June 8, 2026 at 6:06 pm

    Check this msdn thread on embedding an image

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

Sidebar

Related Questions

I'm having trouble sending email using my gmail account. I'm pulling my hair out.
I am having some trouble sending values from one page to another using the
as indicated by the title I am having trouble sending an email via my
I was having trouble sending up a url containing accent characters using IE. Here's
Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I'm having trouble sending data to a different view using the prepareForSegue method… I
I'm having some trouble sending $_FILES by cURL - the files get transferred alright
I'm having trouble sending mail using SMTP from a Rails app. I have a
I am sending emails using utl_mail.send(), and it is possible that some of the
I am having trouble sending emails with PHP. Can you see any problems in

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.