-1

I'm using a command line switch to generate an email but would like to format the email to include some bold words in the body. I tried using <b> for example but since the email is formatted as plain text when using a command line switch it's not making anything bold. Is this functionality available?

KHeaney
  • 785
  • 8
  • 18
dmdiller
  • 1
  • 1

2 Answers2

0

You cannot do that from command line or using the mailto: url. You need to use the Outlook Object Model and set the HTMLBody property.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
0

RFC 2368 states the following:

The special hname "body" indicates that the associated hvalue is the body of the message. The "body" hname should contain the content for the first text/plain body part of the message. The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies.

You can't add any formatting to the body text when the mailto: command is used.

Instead, you may consider implementing the task using in following ways:

  1. Use any third-party components or BCL classes (from .net framework) for sending emails.
  2. Automate Outlook. See How to automate Outlook from another program for more information.

The Outlook object model provides three main ways for working with item bodies. See Chapter 17: Working with Item Bodies for all of them.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45