Account
VBA Mailer has its own interpretation of Account, quite different from that of Outlook. Essentially it contains information needed to be able to send emails using SMTP and to store them using IMAP.
To create a new account:
New(SMTPAddress, SMTPPassword, DisplayName, SMTPServer, int SMTPPort,
MailKit.Security.SecureSocketOptions SecureSocketOptions, bool UseIMAP,
IMAPServer, IMAPPort, IMAPServerPassword,
bool SaveOnServer, IMAPSentFolder, IMAPDraftsFolder,
bool IsDefaultAccount)
Methods
Properties
SMTPAddress
Returns a String representing the Simple Mail Transfer Protocol (SMTP) address for the Account. Read-only.
SMTPPassword
IMAP is for receiving emails, SMTP is for sending emails. They're different protocols and the passwords used to authenticate each can theoretically be different but are usually the same
DisplayName
DisplayName is free to be specified, initial value can be obtained from current system, a UserName not included, can't be known as is specified on server
SMTPServer
Gets or sets the name of the SMTP relay mail server to use to send email messages.
SMTPPort
Although port 587 is the standard port for secure SMTP email transmission, older systems sometimes rely on ports 25, 465, or 2525
SMTP ports direct email to the correct destination. Picking the right port during your email setup ensures that messages are secure, delivered properly, and not flagged as spam
- Port 25: The Original SMTP Port
- Port 465: The Secure SMTP Port
- Port 587: The Recommended SMTP Port
- Port 2525: An Alternative SMTP Port
LogSentMail
Creates a logbook with the send mail
SecureSocketOptions
MailKit.Security.SecureSocketOptions SecureSocketOptions { get; set; }
The useSsl argument only controls whether or not the client makes an SSL-wrapped connection. In other words, even if the useSsl parameter is false, SSL/TLS may still be used if the mail server supports the STARTTLS extension.
To disable all use of SSL/TLS, use the Connect(String, Int32, SecureSocketOptions, CancellationToken) overload with a value of SecureSocketOptions.None instead.
None 0 No SSL or TLS encryption should be used.
Auto
1 Allow the IMailService to decide which SSL or TLS options to use (default). If the server does not support SSL or TLS, then the connection will continue without any encryption.
SslOnConnect
2 The connection should use SSL or TLS encryption immediately.
StartTls
3 Elevates the connection to use TLS encryption immediately after reading the greeting and capabilities of the server. If the server does not support the STARTTLS extension, then the connection will fail and a NotSupportedException will be thrown.
StartTlsWhenAvailable
4 Elevates the connection to use TLS encryption immediately after reading the greeting and capabilities of the server, but only if the server supports the STARTTLS extension.
UseIMAP
IMAP, Internet Message Access Protocol, is a protocol that enables email clients to access and retrieve messages from servers over TCP/IP connection.
IMAPServer
An IMAP server typically listens on port number 143. IMAP over SSL/TLS (IMAPS) is assigned the port number 993
IMAPPort
IMAP — Port 143 and 993: The former is the standard unencrypted port for IMAP, while the latter is the recommended port with SSL/TLS encryption. You can use one or the other depending on your security needs
IMAPServerPassword
Your IMAP password is the password to an email account that is configured to use IMAP
IMAPSentFolder
2006: The IMAP folders are stored in the database, in the folder hm_imapfolders. The hm_messasges table contains a list of all the users messages. This table also conains information on what IMAP folder they are stored in
IMAPDraftsFolder
Drafts are typically stored on the email server, not just on your local device
IMAP stores email on your provider's servers. It provides you reliable off-site storage of your emails. If your email data is important to you, IMAP is the better way to go. If you're dealing with email on multiple devices—say a mobile device and a desktop computer—IMAP automatically keeps everything in sync.
SaveOnServer
Specifies default to determine if a sent email MailItem will be stored on the IMAP server.
IsDefaultAccount
If MailItem.SendUsingAccount is not specified, the account which has been set as DefaultAccount is used.
Remarks
UserName not included, can't be known as is specified on server
DisplayName is free to be specified, initial value can be obtained from current system