WebMailMan2 ActiveX Reference (Visual Basic)

WebMailMan2

The Chilkat MailMan class is reponsible for sending email though SMTP and receiving/managing email on POP3 servers.

Advertisement

Reference Index
Chilkat Home
CreateObject
Example Programs

Properties

AllOrNone
AutoGenMessageId
AutoSaveCerts
AutoUnwrapSecurity
ConnectTimeout
DsnEnvid
DsnNotify
DsnRet
EmbedCertChain
Filter
HeloHostname
LastErrorHtml
LastErrorText
LastErrorXml
LastSendQFilename
LastSmtpStatus
LogMailReceivedFilename
LogMailSentFilename
MailHost
MailPort
MaxCount
OpaqueSigning
Pop3SPA
PopPassword
PopSsl
PopUsername
ReadTimeout
ResetDateOnLoad
SendIndividual
SizeLimit
SmtpAuthMethod
SmtpHost
SmtpLoginDomain
SmtpPassword
SmtpPort
SmtpSsl
SmtpUsername
StartTLS
Version

Methods

CheckMail
ClearBadEmailAddresses
CopyMail
DeleteBundle
DeleteByUidl
DeleteEmail
DeleteMultiple
FetchEmail
FetchMime
FetchMultiple
FetchMultipleHeaders
FetchMultipleMime
GetAllHeaders
GetBadEmailAddresses
GetFullEmail
GetHeaders
GetUidls
IsSmtpDsnCapable
LoadEml
LoadMbx
LoadMime
LoadXmlEmail
LoadXmlEmailString
LoadXmlFile
LoadXmlString
MxLookup
NewBundle
NewEmail
QuickSend
RenderToMime
SaveLastError
SendBundle
SendCGI
SendEmail
SendMime
SendMimeQ
SendQ
SendQ2
SendToDistributionList
TransferMail
TransferMultipleMime
UnlockComponent
VerifyPopConnection
VerifyPopLogin
VerifySmtpConnection
VerifySmtpLogin

Properties

AllOrNone As Long

Prevents sending any email if any of the addresses in the recipient list are rejected by the SMTP server. The default value is false (0 in ActiveX) which indicates that the mail sending should continue even if some email addresses are invalid. (Note: Not all SMTP servers check the validity of email addresses, and even for those that do, it is not 100% accurate.)

AutoGenMessageId As Long

The Message-ID header field should contain a unique message ID for each email that is sent. The default behavior of the mailman is to auto-generate this header field at the time the message is sent. This makes it easier for the same email object to be re-used. If the message ID is not unique, the SMTP server may consider the message to be a duplicate of one that has already been sent, and may discard it without sending. This property controls whether message IDs are automatically generated. If auto-generation is turned on, the value returned by GetHeaderField("Message-ID") will not reflect the actual message ID that gets sent with the email.

AutoSaveCerts As Long

Controls whether certificates found in incoming signed emails are automatically saved to the "Chilkat" certificate store. The default is False. The Chilkat cert store is located in the registry in HKEY_LOCAL_MACHINE/Software/Chilkat/SystemCertificates.

AutoUnwrapSecurity As Long

When an email is downloaded from a POP3 server, or when it is loaded from a file, ChilkatMailMan automatically "unwraps" it if the email is signed and/or encrypted. The results of the digital signature verification and decryption can be accessed with the following ChilkatEmail properties and methods: EncryptedBy, SignedBy, ReceivedEncrypted, ReceivedSigned, GetEncryptedByCert, and GetSignedByCert. The AutoUnwrapSecurity property controls whether the automatic unwrap occurs or not. By default, this property is set to 1, which enables the auto-unwrap. Setting the property to 0 disables it, allowing for the S/MIME message parts or envelopes to be saved or accessed.

ConnectTimeout As Long

The time (in seconds) to wait before while trying to connect to a mail server (POP3 or SMTP).

DsnEnvid As String

(An SMTP DSN service extension feature) An arbitrary string that will be used as the ENVID property when sending email. See RFC 3461 for more details.

DsnNotify As String

(An SMTP DSN service extension feature) A string that will be used as the NOTIFY parameter when sending email. (See RFC 3461 for more details. ) This string can be left blank, or can be set to "NEVER", or any combination of a comma-separated list of "SUCCESS", "FAILURE", or "NOTIFY".

DsnRet As String

(An SMTP DSN service extension feature) A string that will be used as the RET parameter when sending email. (See RFC 3461 for more details. ) This string can be left blank, or can be set to "FULL" to receive entire-message DSN notifications, or "HDRS" to receive header-only DSN notifications.

EmbedCertChain As Long

If true (1 in ActiveX), causes the digital certificate chain to be embedded in signed emails. The certificates in the chain of authentication are embedded up to but not including the root certificate.

Filter As String

An expression that is applied to any of the following method calls when present: LoadXmlFile, LoadXmlString, LoadMbx, CopyMail, and TransferMail. For these methods, only the emails that match the filter's expression are returned in the email bundle. In the case of TransferMail, only the matching emails are removed from the mail server. The filter allows any header field, or the body, to be checked.

Here are some examples of expressions:

Body like "mortgage rates*". 
Subject contains "update" and From contains "chilkat" 
To = "info@chilkatsoft.com" 

Here are the general rules for forming filter expressions:

Any MIME header field name can be used, case is insensitive. 
Literal strings are double-quoted, and case is insensitive. 
The "*" wildcard matches 0 or more occurances of any character. 
Parentheses can be used to control precedence. 
The logical operators are: AND, OR, NOT (case insensitive) 
Comparison operators are: =, <, >, <=, >=, <> 
String comparison operators are: CONTAINS, LIKE (case insensitive)

HeloHostname As String

Specifies the hostname to be used for the EHLO/HELO command sent to an SMTP server. By default, this property is an empty string which causes the local hostname to be used.

LastErrorHtml As String (read-only)

Error information in HTML format for the last method called.

LastErrorText As String (read-only)

Error information in plain-text format for the last method called.

LastErrorXml As String (read-only)

Error information in XML format for the last method called.

LastSendQFilename As String (read-only)

The name of the file created in the SMTPQ's queue directory for the last email sent via SendQ, SendQ2, or SendMimeQ.

LastSmtpStatus As Long (read-only)

Returns the last SMTP diagnostic status code. This can be checked after sending an email. SMTP reply codes are defined by RFC 821 - Simple Mail Transfer Protocol.

LogMailReceivedFilename As String

A log filename where the MailMan will log each message in the exact form it was received from a POP3 server. This property is provided for help in debugging.

LogMailSentFilename As String

A log filename where the MailMan will log the exact message sent to the SMTP server. This property is helpful in debugging.

MailHost As String

The hostname of the POP3 server.

MailPort As Long

The port number of the POP3 server. Only needs to be set if the POP3 server is running on a non-standard port.

MaxCount As Long

Limits the number of messages the MailMan will try to retrieve from the POP3 server in a single method call.

OpaqueSigning As Long

When set to True, signed emails are sent using opaque signing. The default is to send clear-text (multipart/signed) emails.

Pop3SPA As Long

Controls whether SPA authentication for POP3 is used or not. (For ActiveX components, the property is a Long value that should be set to 1 or 0.) To SPA authenticate, simply set the mailman.Pop3SPA property = true (or 1). No other programming changes are required.

PopPassword As String

The POP3 password.

PopSsl As Long

Controls whether SSL is used when reading email from a POP3 server. Note: Check first to determine if your POP3 server can accept SSL connections. Also, be sure to set the MailPort property to the SSL POP3 port number, which is typically 995.

Set to 1 for SSL, 0 for unencrypted TCP/IP connection.

PopUsername As String

The POP3 login name.

ReadTimeout As Long

The maximum number of seconds to wait for new data to arrive from the POP3 server. A value of 0 (the default) sets the timeout to infinity. Setting a reasonable timeout value will prevent your application from hanging if the POP3 server stops responding. (The ReadTimeout is the amount of time that needs to elapse while no additional data is forthcoming. During a long data transfer, if the data stream halts for more than this amount, it will timeout. Otherwise, there is no limit on the length of time for the entire data transfer.)

ResetDateOnLoad As Long

Controls whether the Date header field is reset to the current date/time when an email is loaded from LoadMbx, LoadEml, LoadMime, LoadXml, or LoadXmlString. The default is false.

SendIndividual As Long

This property determines how emails are sent to distribution lists. If True, emails are sent to each recipient in the list one at a time, with the "To"header field containing the email address of the recipient. If False, emails will contain in the "To"header field, and are sent to 100 BCC recipients at a time. As an example, if your distribution list contained 350 email addresses, 4 emails would be sent, the first 3 having 100 BCC recipients, and the last email with 50 BCC recipients.The default is value of this property is True.

SizeLimit As Long

The MailMan will not try to retrieve mail messages from a POP3 server that are greater than this size limit. The default value is 0 indicating no size limit. The SizeLimit is specified in number of bytes.

SmtpAuthMethod As String

This property should usually be left empty. The MailMan will by default choose the most secure login method available to prevent unencrypted username and passwords from being transmitted if possible. However, some SMTP servers may not advertise the authorization methods it accepts to some or all clients, and therefore Chilkat Email.NET cannot determine which authorization method to use. To force a particular method to be used, or to prevent any authorization from being used, set this property to one of the following values: "NONE", "LOGIN", "PLAIN", "CRAM-MD5", or "NTLM".

SmtpHost As String

The hostname where the SMTP server is located.

SmtpLoginDomain As String

The Windows domain for logging into the SMTP server. Use this only if your SMTP server requires NTLM authentication, which means your SMTP server uses Integrated Windows Authentication. If there is no domain, this can be left empty.

SmtpPassword As String

The password for logging into the SMTP server. Use this only if your SMTP server requires authentication. Chilkat Email.NET supports the LOGIN, PLAIN, CRAM-MD5, and NTLM login methods, and it will automatically choose the most secure method available. Additional login methods will be available in the future.

SmtpPort As Long

The port number of the SMTP server used to send email. Only needs to be set if the SMTP server is running on a non-standard port.

SmtpSsl As Long

When set to True, causes the mailman to connect to the SMTP server via the SSL protocol.

SmtpUsername As String

The login for logging into the SMTP server. Use this only if your SMTP server requires authentication.

StartTLS As Long

When set to true (1 for ActiveX) causes the mailman to issue a STARTTLS command to switch over to a secure SSL/TLS connection prior to authenticating and sending email.

Version As String (read-only)

The version of this component, such as "v1.0.0"

Methods

CheckMail() As Long

Returns the number of emails available on the POP3 server. Returns -1 if the POP3 server could not be reached, or if the login failed. Check the LastErrorText property for more information if this happens.

ClearBadEmailAddresses()

Clears the list of bad email addresses stored within the MailMan object. When email-sending methods are called, any email addresses rejected by the SMTP server will be stored within the MailMan object, and can be accessed by calling the GetBadEmailAddresses method. This method clears the internal list.

CopyMail() As WebBundle2

Copy the email from a POP3 server into a EmailBundle. This does not remove the email from the POP3 server.

DeleteBundle(bundle As WebBundle2) As Long

Removes all the emails present in the bundle from the POP3 email server.

DeleteByUidl(uidl As String) As Long

Removes a single email from the server. Returns the a status code having one of the following values:[-2] Failed to connect to the POP3 server.[-1] Connected to the POP3 server, but failed to login or issue delete command[0] The UIDL was not found on the server.[1] The UIDL existed on the server and was deleted.

DeleteEmail(email As WebEmail2) As Long

Removes an email from the mail server. The email argument is an email that was previously downloaded from the mail server, either in its entirety, or partially (as with GetAllHeaders or GetHeaders).

DeleteMultiple(uidlArray As CkStringArray) As Long

Removes from the POP3 mail server any email that has a UIDL equal to one of the UIDLs in the StringArray.

FetchEmail(uidl As String) As WebEmail2

Fetches an email from the POP3 mail server given its UIDL. The email will remain on the mail server. A typical program might get the email headers from the POP3 server by calling GetAllHeaders or GetHeaders, and then fetch individual emails via their UIDL properties one at a time.

FetchMime(uidl As String) As Variant

Fetches an email by UIDL and returns the MIME source of the email in a byte array. On failure, the data returned will be zero in length.

FetchMultiple(uidlArray As CkStringArray) As WebBundle2

Given an array of UIDL strings, fetchs all the emails from the POP3 server whose UIDL is present in the array, and returns the emails in a bundle.

FetchMultipleHeaders(uidlArray As CkStringArray, numBodyLines As Long) As WebBundle2

Given an array of UIDL strings, fetchs all the email headers from the POP3 server whose UIDL is present in the array.

FetchMultipleMime(uidlArray As CkStringArray) As CkStringArray

Given an array of UIDL strings, fetchs all the emails from the POP3 server whose UIDL is present in the array, and returns the MIME source of each email in a string collection object. Returns a NULL object reference on failure.

GetAllHeaders(numBodyLines As Long) As WebBundle2

Returns all the emails from the POP3 server, but only the first numBodyLines lines of the body. Attachments are not returned. The emails returned in the EmailBundle are valid ChilkatEmail objects, the only difference is that the body is truncated to include only the top numBodyLines lines.

GetBadEmailAddresses(strArray As CkStringArray)

Returns a StringArray object containing the list of failed and invalid email addresses that have accumulated during SMTP sends. The list will not contain duplicates. Also, this only works with some SMTP servers -- not all SMTP servers check the validity of each email address.

GetFullEmail(email As WebEmail2) As WebEmail2

If a partial email was obtained using GetHeaders or GetAllHeaders, this function will take the partial email as an argument, and download the full email from the server. A new Email object (separate from the partial email) is returned.

GetHeaders(numBodyLines As Long, fromIndex As Long, toIndex As Long) As WebBundle2

The same as the GetAllHeaders method, except only the emails from fromIndex to toIndex on the POP3 server are returned. The first email on the server is at index 0.

GetUidls(out As [) As retval ] ICkStringArray *

Returns the UIDLs of the emails currently stored on the POP3 server.

IsSmtpDsnCapable() As Long

Contacts the SMTP server and determines if it supports the DSN (Delivery Status Notification) features specified by RFC 3461 and supported by the DsnEnvid, DsnNotify, and DsnRet properties. Returns True if the SMTP server supports DSN.

LoadEml(emlFilename As String) As WebEmail2

Loads an Outlook Express EML (.eml) file and converts it to a Chilkat Email object. Returns NULL if it failed.

LoadMbx(mbxFileName As String) As WebBundle2

Loads a .mbx file containing emails and returns an email bundle. If a Filter is present, only emails matching the filter are returned.

LoadMime(mimeText As String) As WebEmail2

Creates an Email object from MIME text in memory

LoadXmlEmail(emailFilename As String) As WebEmail2

Loads an XML file containing a single email and returns an Email object.

LoadXmlEmailString(xmlString As String) As WebEmail2

Loads an XML string containing a single email and returns an Email object.

LoadXmlFile(folderPath As String) As WebBundle2

Loads an XML file containing emails and returns an email bundle. If a Filter is present, only emails matching the filter are returned.

LoadXmlString(xmlString As String) As WebBundle2

Loads from an XML string containing emails and returns an email bundle. If a Filter is present, only emails matching the filter are returned.

MxLookup(emailAddress As String) As String

Performs a DNS MX lookup to return the mail server hostname based on an email address. Returns NULL if the MX lookup failed.

NewBundle() As WebBundle2

Creates and returns a new email bundle object.

NewEmail() As WebEmail2

Creates and returns a new email object.

QuickSend(from As String, to As String, subject As String, body As String, smtpServer As String) As Long

A quick way to send an email to a single recipient without having to create an Email object explicitly. Returns 1 on successful delivery, and 0 if failed.

RenderToMime(email As WebEmail2) As String

When an email is sent by calling SendEmail, it is first "rendered" according to the values of the email properties and contents. It may be digitally signed, encrypted, values substituted for replacement patterns, and header fields "Q"or "B" encoded as needed based on the email. The RenderToMime method performs the rendering, but without the actual sending. The MIME text produced is exactly what would be sent to the SMTP server had SendEmail been called. (The SendEmail method is effectively the same as calling RenderToMime followed by a call to SendRendered.)

SaveLastError(filename As String) As Long

Saves the last error information to an XML formatted file.

SendBundle(bundle As WebBundle2) As Long

Send a bundle of emails. Returns True if every email was successfully sent, otherwise returns false and the XML error log should be consulted for details.

SendCGI(url As String, email As WebEmail2) As Long

Not Implemented. Do not use this method.

SendEmail(email As WebEmail2) As Long

Sends an email using the MailMan SMTP property settings.

Returns 1 for success, 0 for failure.

SendMime(from As String, recipients As String, mimeMsg As String) As Long

Provides complete control over the email that is sent. The MIME text passed in the 3rd argument is passed exactly as-is to the SMTP server. The recipients of the email are passed as a string of comma separated email addresses (without friendly names).

SendMimeQ(from As String, recipients As String, mimeMsg As String) As Long

Same as SendMime, except the email is written to the Chilkat SMTPQ's queue directory for background sending.

SendQ(email As WebEmail2) As Long

Queue an email to be sent using the Chilkat SMTP queue service.

SendQ2(email As WebEmail2, queueDir As String) As Long

Same as SendQ, but the queue directory can be explicitly specified in a method argument.

SendToDistributionList(email As WebEmail2, distList As CkStringArray) As Long

Send the same email to a list of email addresses.

TransferMail() As WebBundle2

Transfer the emails from the POP3 server into a EmailBundle. The email is removed from the POP3 server.

TransferMultipleMime(uidlArray As CkStringArray) As CkStringArray

Same as FetchMultipleMime except that the downloaded emails are also deleted from the server.

UnlockComponent(code As String) As Long

Unlocks the component allowing for the full functionality to be used. Returns true if the unlock code is valid.

VerifyPopConnection() As Long

Return True if a connection can be established with the POP3 server, otherwise return False.

VerifyPopLogin() As Long

Return True if a connection and login is successful with the POP3 server. Otherwise return False.

VerifySmtpConnection() As Long

Return True if a connection can be established with the SMTP server, otherwise return False.

VerifySmtpLogin() As Long

Return True if a connection and login is successful with the SMTP server. Otherwise return False.

Copyright 2000-2006 Chilkat Software, Inc.