|

ChilkatMailMan
Connects
to POP3 and SMTP servers to download or send email.
See
Also: ChilkatEmail,
ChilkatEmailBundle
ChilkatMailMan
Properties
POP3
Server Properties
SMTP Server Properties
Distribution Lists
Filter and Other Properties
POP3
Server Properties
(BACK)
- MailHost
As String read/write
- The hostname where
the POP3 server is located.
(BACK)
- MailPort
As Long read/write
- The port number
of the POP3 server. Only needs to be set if the POP3 server
is running on a non-standard port.
(BACK)
- PopPassword
As String read/write
- The password for
logging into the POP3 server.
(BACK)
-
- PopUsername
As String read/write
- The username for
logging into the POP3 server.
(BACK)
- ConnectTimeout
As Long read/write
- The maximum number
of seconds to wait when connecting to a POP3 or SMTP server.
The default is 5 seconds.
(BACK)
- ReadTimeout
As Long read/write
- 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.
(BACK)
SMTP Server Properties
(BACK)
- SmtpHost
As String read/write
- The hostname of
the SMTP server used to send email. (BACK)
- SmtpPort
As Long read/write
- 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. (BACK)
- SmtpPassword
As String read/write
- The password for
logging into the SMTP server. Use this only if your SMTP server
requires authentication. Chilkat Mail supports the LOGIN, PLAIN,
and CRAM-MD5 login methods, and it will automatically choose
the most secure method available. Additional login methods will
be available in the future. (BACK)
- SmtpUsername
As String read/write
- The login for logging
into the SMTP server. Use this only if your SMTP server requires
authentication. (BACK)
- SmtpLoginDomain
As String read/write
- 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. (BACK)
- SmtpAuthMethod
As String read/write
- This property should
usually be left empty. The ChilkatMailMan 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 Mail
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". (BACK)
Distribution
Lists
(BACK)
- SendIndividual
As Boolean read/write
- 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
<undisclosed-recipients> 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. (BACK)
Filter and Other Properties
(BACK)
- AutoSaveCerts
As Long read/write
- Controls whether
certificates found in incoming signed emails are automatically
saved to the "Chilkat" certificate store. The default
is TRUE. The Chilkat cert store is located in the registry in
HKEY_LOCAL_MACHINE/Software/Chilkat/SystemCertificates. (BACK)
- AutoUnwrapSecurity
As Long read/write
- 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. (BACK]
- ErrorLogHtml
As String read-only
- Error information
for the last method call formatted as HTML with "<br>"
line endings.
- ErrorLogText
As String read-only
- Error information
for the last method call formatted as plain-text with CRLF line
endings.
- ErrorLogXml
As String read-only
- Error information
for the last method call formatted as XML.
- Filter
As String read/write
- 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 POP3 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)
(BACK)
- LogMailSentFilename
As String read/write
- Set this property
to a log filename where you would like ChilkatMail to log each
message in the form it is sent to the SMTP server. This property
is provided for help in debugging. If the mail being sent via
ChilkatMail is not received as expected, please send a problem
report to help@chilkatsoft.com
and include the email that was logged to this file.
(BACK)
- LogMailReceivedFilename
As String read/write
- Set this property
to a log filename where you would like ChilkatMail to log each
message in the form it was received from a POP3 server. This
property is provided for help in debugging. If there is a problem
with a particular email, please send a problem report to help@chilkatsoft.com,
and include the email that was logged to this file.
(BACK)
- MaxCount
As Long read/write
- Tells the mailman
to never read more than this many messages at a time from the
POP3 server. (BACK)
- ResetDateOnLoad
As Long read/write
- Controls whether
the Email date is reset to the current date/time whenever it
is re-created by loading it from a file or memory. This affects
the following methods: LoadMbx, LoadEml, LoadMime, LoadXmlFile,
and LoadXmlString. (BACK)
- SizeLimit
As Long read/write
- Tells the mailman
to not read any messages that are greater than this size in
bytes. (BACK)
- Version
As String read-only
- The version of
this ChilkatMail control. (BACK)
ChilkatMailMan
Methods
Sending
Email
Receiving Email
Managing Email on the Server
Checking Servers
XML, MBX, and EML Import/Export
Unlocking,
Logging, and Other
- Sending
Email
(BACK)
- ClearBadEmailAddresses()
- Clears the list
of bad email addresses that may have accumulated during SMTP
sends. (see GetBadEmailAddresses below)..(BACK)
- GetBadEmailAddresses()
As CkStringArray
- Returns a CkStringArray
object containing the list of failed 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.(BACK)
- QuickSend(from
As String, recipient As String, subject As String, body As String,
smtpHostname As String) As Long
- A quick way to
send an email to a single recipient without having to create
a ChilkatEmail object explicitly. Returns 1 on successful delivery,
and 0 if failed. (BACK)
- RenderToMime(email
As ChilkatEmail) 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.)
- SendEmail(email
As ChilkatEmail) As Long
- Send an email.
If mail was not successfully sent to any recipients, then an
error is raised. If mail was successfully sent to all recipients,
then a value of 1 is returned. If mail was successfully sent
to some, but not all of the recipients, then a value of 0 is
returned and no error is raised. In summary:
- Nobody got the
email: Function returns 0 and error is raised.
- Everybody got the
email: Function returns 1.
- Some, but not everyone,
got the email: Function returns 0, but error is not raised.
(BACK)
- SendBundle(bundle
As ChilkatEmailBundle) As Long
- Send a bundle of
emails. Return value:
- Nobody got any
emails: Function returns 0 and error is raised.
- Everybody got all
emails: Function returns 1.
- Some, but not everyone,
got the emails: Function returns 0, but error is not raised.
(BACK)
- SendMime(from
As String, recipients As String, mimeEmail As String) As Long
- Sends a pre-constructed
MIME-formatted email. The recipients and sender are specified
in the method parameters, and can be different than what is
specified in the email header fields. The output of ChilkatEmail.GetMime
can be passed in to the last parameter of this method. Returns
1 for success and 0 for failure.
- SendQ(email
As ChilkatEmail) As Long
- Sends an email
via the Chilkat
smtpQ service. Returns 1 for success and 0 for failure.
- SendRendered(mimeText
As String) As Long
- Connects to the
SMTP server and sends an email by transmitting the MIME text
exactly as specified in the parameter. The recipients are determined
by the "To" and "CC" header fields in the
MIME text. Returns 1 for success and 0 for failure.
Receiving
Email
(BACK)
- CheckMail()
As Long
- Return the number
of emails on the POP3 server. Returns -1 if unable to check
the POP server for any reason.
(BACK)
- CopyMail()
As ChilkatEmailBundle
- Copy the mail from
a POP3 server into a ChilkatEmailBundle. This does not remove
the email from the POP3 server. (BACK)
- TransferMail()
As ChilkatEmailBundle
- Transfer the emails
from the POP3 server into a ChilkatEmailBundle. (BACK)
- FetchEmail(uidl
as String) As ChilkatEmail
- Fetches an email
from the POP3 server given its UIDL. The email is left on the
POP3 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. (BACK)
- FetchMultiple(uidlArray
as CkStringArray) As ChilkatEmailBundle
- Given an array
of UIDL strings, this method fetchs all the emails from the
POP3 server whose UIDL is present in the array, and returns
the emails in a bundle. See CkStringArray
for information regarding CkStringArray. (BACK)
- FetchMultipleHeaders(uidlArray
as CkStringArray, long numBodyLines) As ChilkatEmailBundle
- Given an array
of UIDL strings, this method fetchs all the email headers from
the POP3 server whose UIDL is present in the array. See CkStringArray
for information regarding CkStringArray. (BACK)
- GetAllHeaders(numBodyLines
as Long) As ChilkatEmailBundle
- 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 ChilkatEmailBundle are valid ChilkatEmail objects,
the only difference is that the body is truncated to include
only the top numBodyLines lines. (BACK)
- GetFullEmail(email
as ChilkatEmail) As ChilkatEmail
- 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 ChilkatEmail
object (separate from the partial email) is returned. (BACK)
- GetHeaders(numBodyLines
as Long, fromIndex as Long, toIndex as Long) As ChilkatEmailBundle
- 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. (BACK)
Managing
Email on the Server
(BACK)
- DeleteEmail(email
As ChilkatEmail)
- Removes an email
from the POP3 server. The email argument is an email
that was previously downloaded from the POP3 server, either
in its entirety, or partially (as with GetAllHeaders
or GetHeaders). (BACK)
- DeleteBundle(bundle
As ChilkatEmailBundle)
- Removes all the
emails present in the bundle from the POP3 server. (BACK)
- 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.
(BACK)
- DeleteMultiple(uidlArray
As CkStringArray)
- Removes from the
POP3 server any email that has a UIDL equal to one of the UIDLs
in the array. See CkStringArray
for information regarding that object. (BACK)
- GetUidls()
As CkStringArray
- Returns the UIDLs
of the emails currently stored on the POP3 server. (BACK)
- Checking
Servers
(BACK)
- VerifyPopConnection(void)
As Long
- Returns 1 if a
connection can be made to the POP server, otherwise returns
0. (BACK)
- VerifyPopLogin(void)
As Long
- Attempts to login
to the POP server and returns 1 if successful, otherwise returns
0. (BACK)
- VerifySMTPConnection(void)
As Long
- Returns 1 if a
connection can be made to the SMTP server, otherwise returns
0. (BACK)
- VerifySMTPLogin(void)
As Long
- Attempts to login
to the SMTP server and returns 1 if successful, otherwise returns
0. (BACK)
XML,
EML and MBX Import/Export
(BACK)
- LoadEml(filename
As String) As ChilkatEmail
- Reads a .eml file
returns the email.(BACK)
- LoadMbx(filename
As String) As ChilkatEmailBundle
- Loads a .mbx file
containing emails and returns an email bundle. If a Filter is
present, only emails matching the filter are returned. (BACK)
- LoadMime(mimeText
As String) As ChilkatEmail
- Creates a ChilkatEmail
object from a MIME string. (BACK
- LoadXmlEmail(filename
As String) As ChilkatEmail
- Loads an XML file
containing a single email and returns a ChilkatEmail object.
(BACK)
- LoadXmlEmailString(xmlText
As String) As ChilkatEmail
- Loads an XML string
containing a single email and returns a ChilkatEmail object.
(BACK)
- LoadXmlFile(filename
As String) As ChilkatEmailBundle
- Loads an XML file
containing emails and returns an email bundle. If a Filter is
present, only emails matching the filter are returned. (BACK)
- LoadXmlString(xmlData
As String) As ChilkatEmailBundle
- Loads from an XML
string containing emails and returns an email bundle. If a Filter
is present, only emails matching the filter are returned. (BACK)
Unlocking
and Logging
(BACK)
- UnlockComponent(unlockCode
As String)
- Unlocks the mailman
object. An evaluation unlockCode can be obtained from the Chilkat
Software website at http://www.chilkatsoft.com/register30.asp.
This method must be called immediately after the mailman object
has been instantiated (BACK)
- SaveXmlLog(filename
as String)
- Saves the log in
XML format to a file (BACK)
|