MAPI questions and feedback

  • The MAPI capability is absolutely awesome. Some feedback and questions - .Send returns results as an integer. What are the integer values returned and the meanings of each value? Is 1 the only .Command value?

    Feedback regarding embedded images - Yahoo, MSN, and GMAIL are quite particular about embedded attachments, but they will work slightly better with something like:

    Code
    <IMG src="cid:727254020@15122006-05C9" align=baseline border=0>


    I have done some work around code to insert the CID in the HTML and rename the embedded files, but it would be SO much cleaner if the WPCubed control handled the matter.

    Also, being able to control the various aspects of the SMTPSendMail configuration would be extremely helpful…for example, if you wanted to use a remote mail server...ala CDO..

    • Offizieller Beitrag

    Hi,

    I you use the MAPI interface the Send method will class the API MapiSendMail and return its result value.

    See the documentation here:
    http://msdn2.microsoft.com/en-us/library/ms527908.aspx

    MAPISendMail is defined as:

    ULONG FAR PASCAL MAPISendMail(
    LHANDLE lhSession, ULONG ulUIParam, lpMapiMessage lpMessage, FLAGS flFlags, ULONG ulReserved )

    lhSession is passed as 0

    ulUIParam can be set using the method IWPMapi.SetAppHandle

    lpMessage will be build by the interface

    flFlags can be set using the property MAPIFlags

    Please note that the function of the Send method depends on the installed mailer. With TheBat! it works very nicely.

    -

    Alternative way to send an e-mail is to use the Prepare method and then extract the propereties from the IWPMapi interface. You can use a differenmt method to send the message which does not require Mapi.

    -

    It is also possible to create a MIME encoded message. Use SaveToString("MIME", false) to create such a message blob. The Mapi e-mail properties will be used by the MIME encoder to add the from and to e-mail addresses to the header.

    Kind Regards,

    Julian Ziersch