LPARAMETERS ; tcText, ; tcHTML, ; tcSubject, ; tcMessage, ; tcFrom, ; tcTo * CDO message hierarchy WITH CREATEOBJECT([CDO.Message]) &&---------------------------------------------&& * BodyParts hierarchy && WITH .BodyPart &&---------------------------------------------------------&& && * Set the header fields && && .ContentMediaType = [multipart/mixed] && && && && * Message BodyPart && && WITH .AddBodyPart &&------------------------------------------------&& && && * TextBody && && && WITH .AddBodyPart() &&----------------------------------------&& && && && * Set the header fields && && && && .ContentMediaType = [text/plain; charset="US-ASCII"] && && && && .ContentTransferEncoding = [quoted-printable] && && && && && && && && * Set the text && && && && WITH .GetDecodedContentStream() && && && && .WriteText(tcText) && && && && .Flush() && && && && ENDWITH && && && && ENDWITH &&----------------------------------------------------&& && && && && && && * HTMLBody && && && WITH .AddBodyPart() &&----------------------------------------&& && && && * Set the header fields && && && && .ContentMediaType = [text/html; charset="US-ASCII"] && && && && .ContentTransferEncoding = [quoted-printable] && && && && && && && && * Set the text && && && && WITH .GetDecodedContentStream() && && && && .WriteText(tcHTML) && && && && .Flush() && && && && ENDWITH && && && && ENDWITH &&----------------------------------------------------&& && && && && && && * This may appear out of order, but we have to set the && && && * content-type for the "multipart/alternative" body part && && && * AFTER adding the two representations. If we'd done it && && && * before, it would've been switched to "multipart/mixed" && && && * for us as soon as we made the first AddBodyPart() call && && && .ContentMediaType = [multipart/alternative] && && && ENDWITH &&----------------------------------------------------------&& && && && && * Attachment BodyPart (of type 'message') && && WITH .AddBodyPart() &&------------------------&& && && * Set the header fields && && && .ContentMediaType = [message/rfc822] && && && .ContentTransferEncoding = [7bit] && && && && && && * Add the attachment && && && WITH .GetDecodedContentStream() && && && .WriteText(tcMessage) && && && .Flush() && && && ENDWITH && && && ENDWITH &&------------------------------------&& && && && && * Attachment BodyPart (of type 'text') && && WITH .AddBodyPart() &&------------------------------------&& && && * Set the header fields && && && .ContentMediaType = [text/plain; name="msg.txt"] && && && .ContentTransferEncoding = [7bit] && && && && && && * Add the attachment && && && WITH .GetDecodedContentStream() && && && .WriteText(tcMessage) && && && .Flush() && && && ENDWITH && && && ENDWITH &&------------------------------------------------&& && && ENDWITH &&----------------------------------------------------------------&& && && * Set the main message headers && .Configuration = This.SMTPConfig(cdoSendUsingPort) && .Subject = tcSubject && .From = tcFrom && .To = tcTo && && * Send the message && .Send() && ENDWITH &&----------------------------------------------------------------------&&