Reference > Script steps reference > Miscellaneous script steps > Send Mail
 
Send Mail
Purpose 
Sends an email message through an email application or via SMTP.
See also 
Format 
Send Mail [Send via E-mail Client/Send via SMTP Server; With dialog: On/Off; To: "<to>"; CC: "<CC>"; BCC: "<BCC>"; Subject: "<subject>"; Message: "<message>"; "<attachment>"]
Options 
With dialog specifies how FileMaker Pro will handle the composed email. If you set With dialog to On, the composed message is left open for review in the email application. (In some applications, the new message is left in the Drafts folder.) If With dialog is Off, FileMaker Pro puts the composed email in the email application's outbox, ready to be sent.
Specify displays the Send Mail dialog box, where you can set options for your mail. Choose the method by which to send mail, E-Mail Client or SMTP Server. (If you choose SMTP Server, the SMTP Options dialog box appears. For information about setting SMTP options, see Entering or editing SMTP options.) Then choose to create One email using data from the current file, or create Multiple emails (one for each record in found set).
Note  If you choose SMTP Server and Multiple emails (one for each record in the found set) and FileMaker encounters an error while emailing one of the records, the remaining records will not be sent.
For each of the following options, you can enter text directly, or enter values from the default email client (Windows), field, or calculation.
Windows: Select Specify Email Addresses to enter one or more email addresses. Separate each address with a semicolon or a carriage return character.
Select Specify Field Name to specify a field that contains one or more email addresses.
Select Specify Calculation to specify a calculation that generates one or more email addresses.
If you use the Specify Field Name option to specify a value for the To, CC, or BCC entries, you can also select Collect addresses across found set to specify that all the values from this field in the current found set be used (to address a message to multiple recipients).
To stores the address(es) of the recipient(s).
CC stores the address(es) of the carbon copy recipient(s).
BCC stores the address(es) of the blind carbon copy recipient(s)
Note  If you specify multiple email addresses for the To, CC, or BCC options, separate each recipient's email address with a carriage return or a semicolon. Some email clients do not accept other separators, such as a comma.
Subject indicates the title for the email.
Message indicates the text of the email. You can type the message as text, use a field value, create a message from a calculation, or insert text from a file.
Select Attach File to select a file to send as an attachment to the mail message. For more information, see Creating file paths.
Compatibility 
 
Where the script step runs 
Supported 
FileMaker Pro 
Yes 
FileMaker Server 
Partial 
FileMaker Go 
Partial 
Custom Web Publishing 
Partial 
FileMaker WebDirect 
Partial 
Runtime solution 
Yes 
Originated in 
FileMaker Pro 6.0 or earlier
Description 
Send Mail sends an intranet or Internet email through an email application or via SMTP (Simple Mail Transfer Protocol).
Notes 
Sending mail using an email application is not supported in Custom Web Publishing or in server-side scripts.
Server-side scripts support sending mail via SMTP. However, if you attach a file, that file needs to be in a folder that FileMaker Server is allowed to access. See Paths in server-side scripts.
FileMaker WebDirect doesn’t support the Attach File option. Web users must manually attach saved or exported files to email messages.
Custom Web Publishing doesn’t support the Attach File option.
FileMaker WebDirect doesn’t support the With dialog: Off option when sending mail via an email client.
FileMaker Go doesn’t support the With dialog: Off option. The email displays on the device, and you can send the message manually.
If this script step sends an email via an email client in FileMaker WebDirect, limit the To, CC, BCC, Subject, and Body options to 2000 characters total. If the email contains more than 2000 characters, the web browser may not allow FileMaker WebDirect to send the message.
To send mail through an email application:
You must have a supported email application installed and configured properly on your computer. See FileMaker Pro technical specifications.
Windows: A [Mail] section in the Win.ini file is required.
If you select Multiple emails and Collect addresses across found set, FileMaker Pro generates an email for every record in the found set. Each message is addressed to everyone specified in the TO, CC and BCC boxes for every record in the found set.
You can create a PDF or a Microsoft Excel file from your data to send as an attachment. For more information, see Save Records As PDF and Save Records As Excel.
The Send Mail script step does not control the font’s appearance. Use the email client to make any changes to the font.
FileMaker Pro sends email as plain text. To edit the message's contents and formatting, choose to send the message through an email client and set the With dialog option to On. You can then edit the message within the email client before it is sent.
FileMaker Pro verifies the SSL certificate of an SMTP server that is using an encrypted connection. If the certificate cannot be verified, users can choose to connect anyway or cancel to skip this script step. If the certificate cannot be verified and the Set Error Capture script step is set to On, this script step behaves as if the server were unavailable. If the certificate cannot be verified in server-side scripts, Custom Web Publishing, and FileMaker WebDirect, this script step behaves as if it had been canceled by the user.
Example 1 
Goes to the Customers layout, performs a find, and sends a prewritten email to the address in the Email field in the current record without prompting the user.
Go to Layout ["Customers"]
Perform Find [Restore]
Send Mail [Send via E-mail Client; With dialog: Off; To: Customers::Email; Subject: Invoices::Summary; Message: "Dear Customer,¶¶Thank you for your business."]
#The Collect addresses across found set option is not selected.
Example 2 
Saves the current record as a PDF, then emails the PDF to the address in the Email field in the current record.
Go to Layout ["Print Invoices"]
Save Records as PDF [Restore; With dialog: Off; "Invoice.pdf"; Current record]
Send Mail [Send via E-mail Client; With dialog: Off; To: Customers::Email; Subject: Invoices::Summary; Message: "Dear Customer,¶¶Thank you for your business. Your invoice is attached."; "Invoice.pdf"]
Go to Layout [original layout]
Related topics 
Script steps reference (alphabetical list)
Script steps reference (category list)