Microsoft KB Archive/818584

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

Article ID: 818584

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Outlook 2002 Standard Edition
 * Microsoft Outlook 2000 Standard Edition

-





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:

https://partner.microsoft.com/global/30000104

For additional information about the support options available from Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

  Define GUID. //Use the GetIDsFromNames MAPI API to get the &quot;Content-Type&quot; // 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;  Use the GUID and MAPI API GetIdsFromNames function to obtain the MAPI string named ID Content-Type property. Set up a SPropValue structure with the ulPropTag member to the Property tag in step 2.

The data type is PT_STRING8. Set the Value.IpszA variable to application/pkcs7-MIME. 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://msdn2.microsoft.com/en-us/library/ms836716.aspx

