Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

MapiMessageMBS.AddFile(file as MapiFileMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Windows MBS Win Plugin 8.3 No Yes No Yes, Windows only No
Function: Adds a file to the message file list.
Notes: file must be not nil.

Feedback, Comments & Corrections

MapiMessageMBS.AddRecipient(recipient as MapiRecipientMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Windows MBS Win Plugin 8.3 No Yes No Yes, Windows only No
Function: Adds a recipient to the message.
Notes: recipient must be nil.

Feedback, Comments & Corrections

MapiMessageMBS.SendMail(DisplayDialog as boolean, DisplayLogonDialog as boolean) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Windows MBS Win Plugin 8.3 No Yes No Yes, Windows only No
Function: Sends an email.
Notes: Same as the other SendMail function, but this one does not take the parent window handle and supports console applications.

See also:

Feedback, Comments & Corrections

MapiMessageMBS.SendMail(parent as window, DisplayDialog as boolean, DisplayLogonDialog as boolean) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Windows MBS Win Plugin 8.3 No Yes No No No
Function: Sends an email.
Notes:
Parameters:

parent:
The parent window for the dialogs used. If not nil the dialogs used will be modal.

DisplayDialog:
A dialog box should be displayed to prompt the user for recipients and other sending options. When Dialog is false, at least one recipient must be specified.

DisplayLogonDialog:
A dialog box should be displayed to prompt the user to log on if required. When the DisplayLogonDialog is false, the client application does not display a logon dialog box and returns an error value if the user is not logged on. SendMail ignores this flag if the MessageID parameter is empty.

Error codes:

const SUCCESS_SUCCESS = 0No error.
const MAPI_USER_ABORT = 1The user canceled one of the dialog boxes. No message was sent.
const MAPI_E_FAILURE = 2One or more unspecified errors occurred. No message was sent.
const MAPI_E_LOGON_FAILURE = 3There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed. No message was sent.
const MAPI_E_DISK_FULL = 4
const MAPI_E_INSUFFICIENT_MEMORY = 5There was insufficient memory to proceed. No message was sent.
const MAPI_E_ACCESS_DENIED = 6
const MAPI_E_TOO_MANY_SESSIONS = 8
const MAPI_E_TOO_MANY_FILES = 9There were too many file attachments. No message was sent.
const MAPI_E_TOO_MANY_RECIPIENTS = 10There were too many recipients. No message was sent.
const MAPI_E_ATTACHMENT_NOT_FOUND = 11The specified attachment was not found. No message was sent.
const MAPI_E_ATTACHMENT_OPEN_FAILURE = 12The specified attachment could not be opened. No message was sent.
const MAPI_E_ATTACHMENT_WRITE_FAILURE = 13
const MAPI_E_UNKNOWN_RECIPIENT = 14
const MAPI_E_BAD_RECIPTYPE = 15The type of a recipient was not TypeTO, TypeCC, or TypeBCC. No message was sent.
const MAPI_E_NO_MESSAGES = 16
const MAPI_E_INVALID_MESSAGE = 17
const MAPI_E_TEXT_TOO_LARGE = 18The text in the message was too large. No message was sent.
const MAPI_E_INVALID_SESSION = 19
const MAPI_E_TYPE_NOT_SUPPORTED = 20
const MAPI_E_AMBIGUOUS_RECIPIENT = 21A recipient matched more than one of the recipient descriptor structures and Dialog is false. No message was sent.
const MAPI_E_MESSAGE_IN_USE = 22
const MAPI_E_NETWORK_FAILURE = 23
const MAPI_E_INVALID_EDITFIELDS = 24
const MAPI_E_INVALID_RECIPS = 25One or more recipients were invalid or did not resolve to any address.
const MAPI_E_NOT_SUPPORTED = 26

The MAPI SendMail function sends a standard message, with or without any user interaction. The profile must be configured so that MAPISendMail can open the default service providers without requiring user interaction.

Client applications can provide a full or partial list of recipient names, subject text, file attachments, or message text. If any information is missing, MAPISendMail can prompt the user for it. If no information is missing, either the message can be sent as is or the user can be prompted to verify the information, changing values if necessary.

A successful return from MAPISendMail does not necessarily imply recipient validation. The message might not have been sent to all recipients. Depending on the transport provider, recipient validation can be a lengthy process.

A "" value for the Subject indicates that there is no text for the subject of the message. A "" value for the NoteText member indicates that there is no message text. Some client applications can truncate subject lines that are too long or contain carriage returns, line feeds, or form feeds.

Each paragraph should be terminated with a CR (0x0d), an LF (0x0a), or a CRLF pair (0x0d0a). MAPISendMail wraps lines as appropriate. If the text exceeds system limits, the function returns the MAPI_E_TEXT_TOO_LARGE value.

The MessageType property is used only by non-IPM applications. Applications that handle IPM messages can set it to "".

The number of attachments per message can be limited in some messaging systems. If the limit is exceeded, the MAPI_E_TOO_MANY_FILES value is returned. File attachments are copied to the message before MAPISendMail returns; therefore, later changes to the files do not affect the contents of the message. The files must be closed when they are copied. Do not attempt to display attachments outside the range of the message text.

Some messaging systems can limit the number of recipients per message. If the client application passes a non-nil value indicating a number of recipients exceeding the system limit, MAPISendMail returns the MAPI_E_TOO_MANY_RECIPIENTS value. If the recipient array is empty, the Dialog parameter must be true in the call to MAPISendMail.

Note that the recipients can include either an entry identifier, the recipient's name, an address, or a name and address pair. The following table shows how MAPISendMail handles the variety of information that can be specified:

Information Action
entry identifierNo name resolution; the name and address are ignored.
nameName resolved using the Simple MAPI resolution rules.
addressNo name resolution; address is used for both message delivery and for displaying the recipient name.
name and addressNo name resolution; name used only for displaying the recipient name.

Client applications that send messages to custom recipients can avoid name resolution. Such clients should set the Address member of the recipient to the custom address.

MAPISendMail does not require an originator-type recipient to send a message.

Important Simple MAPI is not installed by Exchange Server 2003 or later. However, Simple MAPI is supported for use with Exchange 2003. To function properly, the underlying Exchange or Microsoft Outlook® MAPI subsystem must be properly installed on the client computer.

See also:

Feedback, Comments & Corrections

MapiMessageMBS.SendMailMT(DisplayDialog as boolean, DisplayLogonDialog as boolean) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Windows MBS Win Plugin 15.1 No Yes No Yes, Windows only No
Function: Sends an email.
Notes:
Same as the other SendMail function, but threaded.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

See also:

Feedback, Comments & Corrections

MapiMessageMBS.SendMailMT(parent as window, DisplayDialog as boolean, DisplayLogonDialog as boolean) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Windows MBS Win Plugin 15.1 No Yes No No No
Function: Sends an email.
Notes:
Same as the other SendMail function, but threaded.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.




Links
MBS Xojo Plugins