MailEnable Enterprise Guide
Developers / Using the COM component
In This Topic
    Using the COM component
    In This Topic

    This component can be used in any application that supports COM. For example, this component can be used in an ASP page to send email from a web application. This component will work against any SMTP mail server, not just MailEnable. This component is 32bit only. You will not be able to access this DLL from a 64bit application, or from a website running as 64bit. The COM component allows email to be sent to a mail server (this does not need to be a MailEnable mail server). Features include:        

    The COM component allows easy integration of emailing sending from within any COM supporting application. It not only supports sending email to a MailEnable server, but also can be used to send email to any SMTP compatible mail server.





    The name of the file that to add as an attachment.


    The name to call the attachment.


    Allows use of  SMTP authentication.

    0 = No SMTP authentication

    1 = SMTP authentication. You must populate the Username and Password properties in order to authenticate


    The ContentType of the email you are trying to send. For instance, if you wish to send a HTML email, use this property to set the content type to “text/html”.


    This contains the full English language description of the last error. If you encounter an error, you can check this string for a more detailed error.




    This is list of email addresses to BCC the email to. When using multiple email addresses, separate them with a semi-colon ";".


    This is list of email addresses to CC the email to. When using multiple email addresses, separate them with a semi-colon ";".


    This is list of email addresses that are the display name corresponding to the email address set in MailCC. This list is optional. When using multiple email addresses, separate them with a semi-colon ";".


    This is the email address of the sender.


    The display name of the MailFrom email address. This is the friendly name that the end user will see instead of the email address. For example, you may place the full name of the sender, or the department from which the email is coming from.


    The email address to send the email to. To send to multiple email addresses, separate the emails with a semi-colon ";".


    This is the display name that will be shown as the To address. It is usually the full name of the recipient (e.g. "John Smith")


    The message contents.


    An optional property used to force the content for the textual content of the message. If the property is not set, MailEnable will generate a textual version of the message from the HTML content supplied (assuming the ContentType is set as text/html.


    Password to be used for SMTP authentication.


    The post office name for the user


    The email server to connect to. If none is supplied, it will try to connect to the local machine.


    The port to connect to. The default is 25.


    The subject of the email message.


    Username to be used for SMTP authentication





    Adds a custom header to the email. Be careful when using this function, as incorrectly formed headers could prevent the mail from being sent.


    Clears any custom headers that have been added with AddHeader. This would be used to send more than one message (i.e. put this call between the sends).


    Send the email that has been configured with the options. The function will return zero for failure and number greater than zero for success.


    Clears all the settings back to their default.


    Clears the attachments.

    By setting the ContentType value to text/html, the component will generate a HTML and Plain Text representation of the message encapsulated in MIME format.  You need only to set the ContentType property to text/HTML and, when the SendMessage method is called, the component generates the MIME encapsulated message with a multipart alternative content boundary. This boundary then contains respective text/plain and text/HTML boundaries. The mail client then determines which of the alternative content types it wants to read - based on the capabilities of the mail client or the users settings.  If you set the MessageBody and MessageBodyPlain properties of the component, it will not generate a textual representation of the message and will use the property value specified for MessageBodyPlain.

    Advanced settings

    Server wide options for the MEMail component can be configured through the editing of Windows registry keys. If the registry key does not exist it will need to be added. These settings affect all uses of the component on the server.

    The values are located under the following registry branch:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\mail enable\mail enable\Components\MEMail



    Value Type


    Allow attachments


    1 (default) = attachments can be added to emails

    0 = attachments cannot be added to emails

    Attachment Path


    The path must include this string. If the postoffice or mailbox property value has been set on the object then the following variables can be used in the path:



    If these values have been used in the path, but are not provided when someone is using the component then the path from "Default Attachment Path" will be used. The variables above cannot be used in the "Default Attachment Path" setting.

    Default Attachment Path


    This path will be used if no path has been set in the "Attachment Path" setting.