Opens a new email message in the user's email program.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 2.0 Security:
# Syntax
revMail address, [ccAddress, [mailSubject, [messageBody]]]
# Params
- address : A string consisting of one or more email addresses, separated by commas. These addresses appear in the 'To:' header of the email message. - ccAddress : A string consisting of one or more email addresses, separated by commas. These addresses appear in the 'Cc:' header of the email message. - mailSubject : A string consisting of a single line. This text appears in the 'Subject:' header of the email message. - messageBody : This text appears in the 'body' of the email message.
# Examples
revMail "guido@example.net"
revMail "help@example.com",,"Help!",field "Message"
revMail "support@livecode.com","me@example.org","Installation Help"
revMail the bugAddress of this stack,,"Auto Bug Report",myBugsList
# Description
When LiveCode executes the revMail command, the user's email program is opened (if necessary) and a new email message with the specified parameters is created. The user can change any of the settings before sending the message, and the message is not sent automatically: the user must explicitly send it (for example, by clicking a 'Mail' button in the email program).
On Mac OS systems, the mail message is opened in the application the user has set for the 'mailto:' protocol in the Internet control panel (or, for older system versions, Internet Config).
On iOS, revMail hooks into the iOS MessageUI framework.
>*Important:* On Mac OS, the revMail command > requires that AppleScript be installed and that the GURL Apple Event > be supported. GURL support is included in Mac OS 8.5 or later, and > is available for Mac OS 8.0 and 8.1 if the Internet Scripting file > is installed in the Scripting Additions folder inside the Extensions > folder. (This file is installed by the Internet Access installer on > the 8.0 installation CD.) The revMail command is not supported for > Mac OS versions before 8.0.
For some older email programs, it may not be possible to specify a ccAddress, mailSubject, or messageBody. Generally, the revMail command still works with such programs, but only the 'To:' header is set.
>*Note:* When included in a standalone application, the > Common library is implemented as a hidden group and made available > when the group receives its first openBackground message. During the > first part of the application startup process, before > this message is sent, the revMail command is not yet available. > This may affect attempts to use this command in startup, > preOpenStack, openStack, or preOpenCard handlers in > the main stack. Once the application has finished starting up, the > library is available and the revMail command can be used in any > handler.
>*Note:* Once the revMail command is called, you have no more control > over what the user does with the message. They are free to modify the > message and the addresses as they see fit.
# Tags
# See
- **keyword:** file - **message:** startup, openBackground, preOpenStack, openStack, preOpenCard - **command:** mobileComposeUnicodeMail, revGoURL, revMailUnicode, mobileComposeMail, mobileComposeHtmlMail - **object:** stack - **glossary:** parameter, main stack, handler, message, group, Mac OS, standalone application, Apple Event, command, application - **library:** Common library, library