Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
Adds an attachment to this message.
[Visual Basic] Function AddAttachment( ByVal URL as String, [ByVal UserName as String], [ByVal Password as String] ) as IBodyPart [C++] HRESULT AddAttachment( BSTR URL, [BSTR UserName,] [BSTR Password,] IBodyPart** pVal ); [IDL] HRESULT AddAttachment( [in] BSTR URL, [in, optional] BSTR UserName, [in, optional] BSTR Password, [out,retval] IBodyPart** pVal );
The AddAttachment method adds the attachment by first retrieving the resource specified by the Uniform Resource Locator (URL) and then adding the content to the message's Attachments collection within a BodyPart object.
The URL prefixes supported in the URL parameter are file://, ftp://, http://, and https://. The default prefix is file://. This facilitates designation of paths starting with drive letters and of universal naming convention (UNC) paths.
The MIMEFormatted property determines how the attachment is formatted when the message is serialized for delivery to a Simple Mail Transfer Protocol (SMTP) service. If this property is set to True, the attachment is formatted using Multipurpose Internet Mail Extensions (MIME). If the property is set to False, the attachment is added to the serialized content stream in Uuencoded format.
If you populate the HTMLBody property before calling the AddAttachment method, any inline images are displayed as part of the message.
Use the UserName and Password parameters when you are requesting Web pages using the Hypertext Transfer Protocol (HTTP) from a server that requires client authentication. If the Web server supports only the basic or digest authentication mechanisms, these credentials must be supplied. By default the current process security context is used to authenticate when using the NTLM or Negotiate (Kerberos) security packages; however, you can specify alternate credentials with the UserName and Password parameters.
Dim iMsg as New CDO.Message Dim iBp as CDO.IBodyPart Set iBp = iMsg.AddAttachment("http://example.microsoft.com") Set iBp = iMsg.AddAttachment("c:\myfiles\file.doc") ' .. iMsg.Send