| Maptitude GISDK Help |
Initiates a mail program and composes an e-mail with a window as a file attachment.
Added dialog option in Version 6.0/2012.
SendMail(array options)
| Option | Type | Contents |
|---|---|---|
| to | Array | Strings or arrays with e-mail addresses of to: recipients |
| cc | Array | Strings or arrays with e-mail addresses of cc: recipients |
| subject | String | Subject header |
| body | String | Body of message |
| attach | String | Window name of the form "window type|window name" |
| dialog | Boolean | If "True" (default) the message is displayed; if "False" the message is not displayed, but immediately sent. |
The mail program must be initialized in the MAPI section of the win.ini file.
A missing option means that part of the e-mail is blank. Even if there are no options, calling SendMail() will launch your mail program.
A element in the array for the to or cc option can either be a string containing an e-mail address, or an array containing two strings, an e-mail address and a display name for that e-mail address. Some e-mail programs require a display name.
The window must be a map window. It is sent as a .map file. The recipients will need to have the files referred to in the .map file.
Use the dialog option to send a message from a script without it being displayed first.
opts = {}
opts.to = {"info@caliper.com"}
opts.cc = {"sales@caliper.com", {"support@caliper.com", "Tech Support"}}
opts.subject = GetMap()
opts.body = "Here is the latest version of the map. Any comments?"
opts.attach = "Map|" + GetMap()
opts.dialog = "False"
SendMail(opts)
| Error Type | Meaning |
|---|---|
| NotFound | MAPI information cannot be found in the win.ini, or the mapi32.dll is not present |
| Escape | The user escaped out of the mail program |
| Error | The mail program failed in an unspecified way |
| Function | Summary |
|---|---|
| LaunchProgram() | Starts a Windows program |
| ©2025 Caliper Corporation | www.caliper.com |