How to control the encoding of outgoing attachments for a POP3/SMTP transport at the client level in Outlook (818584)



The information in this article applies to:

  • Microsoft Outlook 2002
  • Microsoft Outlook 2000

SUMMARY

This article describes how to change the encoding method of the attachment so that Outlook sends it as Base-64 encoded instead of Quoted-Printable encoded. By default, Outlook encodes outgoing ASCII attachments as Quoted-Printable when you use a POP3/SMTP transport. You cannot control how ASCII attachments are sent through Visual Basic for Applications (VBA) by using the Outlook object model or through the user interface in Outlook.

MORE INFORMATION

You can use the following pseudo code sample to set the Content-Type property in the message that was passed to Outlook to application/pkcs7-MIME. When you make this change, the encoding is set to Base-64 instead of to Quoted-Printable for all ASCII-text attachments that are in the e-mail message. Use either C or C++ with Extended MAPI (Messaging API) or C or C++ in an Outlook Client Extension.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, see the following Microsoft Web site:For additional information about the support options available from Microsoft, visit the following Microsoft Web site:
  1. Define GUID.
       //Use the GetIDsFromNames MAPI API to get the "Content-Type"
       // named property tag using the following GUID.
       GUID guid;
       guid.Data1 = 0x20386;
       guid.Data2 = 0;
       guid.Data3 = 0;
       guid.Data4[0] = 0xC0;
       guid.Data4[1] = 0;
       guid.Data4[2] = 0;
       guid.Data4[3] = 0;
       guid.Data4[4] = 0;
       guid.Data4[5] = 0;
       guid.Data4[6] = 0;
       guid.Data4[7] = 0x46;
    
  2. Use the GUID and MAPI API GetIdsFromNames function to obtain the MAPI string named ID Content-Type property.
  3. Set up a SPropValue structure with the ulPropTag member to the Property tag in step 2.

    The data type is PT_STRING8.
  4. Set the Value.IpszA variable to application/pkcs7-MIME.
  5. Call the IMAPIProp::SetProps property on the message object with the SPropValue structure.
For more detailed information, see the listings in the MAPI Structures section of the MSDN Library. To do so, visit the following MSDN Web site: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/apisp/html/sp__mapi1book_mapi_structures.asp

REFERENCES

For additional information about Base64, click the following article number to view the article in the Microsoft Knowledge Base:

323489 XCON: A Description of Base64 MIME Content Transfer Encoding

For additional information about S/MIME, click the following article numbers to view the articles in the Microsoft Knowledge Base:

286159 Encryption and Message Security Overview

195477 OL2000: Encryption and Message Security Overview


Modification Type:MajorLast Reviewed:5/31/2006
Keywords:kbTransport kbAutomation kbProgramming kbinfo KB818584