Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Build and send HTML Email with inline graphics

All examples are included with download of MBS FileMaker Plugin.

Build and send HTML Email with inline graphics.fmp12

Overview
Tables3
Relationships2
Layouts3
Scripts4
Value Lists1
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
EMail
13 fields defined, 1 record
EMail
Recipient
4 fields defined, 2 records
Recipient
Attachment
5 fields defined, 2 records
Attachment

Fields

Table Name: EMail - 13 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
SMTP ServerNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      SMTP UsernameNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Global
      • Repetitions: 1
      • Index Language: German
          SMTP PasswordNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Global
          • Repetitions: 1
          • Index Language: German
              SubjectNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  FromNameNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      PlainTextNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          HTMLTextNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              EmailIDNormal, NumberAuto-Enter:
                              • Serial: Generate: On creation, Next value: 4, Increment: 1
                              Validation:
                              • Only during data entry
                              • Strict validation
                              Storage:
                              • Repetitions: 1
                              • Indexing: All
                              • Index Language: German
                                  FromEmailNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                      EmailSourceNormal, TextAuto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: None
                                      • Automatically create indexes as needed
                                      • Index Language: German
                                          DebugInputNormal, TextAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              DebugMessagesNormal, TextAuto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  RecipientNormal, TextAuto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German

                                                      Table Name: Recipient - 4 Fields
                                                      Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                                      TypeNormal, TextAuto-Enter:
                                                      • Allow editing
                                                      Validation: Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German
                                                          NameNormal, TextAuto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: German
                                                              EmailNormal, TextAuto-Enter:
                                                              • Allow editing
                                                              Validation:
                                                              • Only during data entry
                                                              Storage:
                                                              • Repetitions: 1
                                                              • Indexing: None
                                                              • Automatically create indexes as needed
                                                              • Index Language: German
                                                                  EmailIDNormal, NumberAuto-Enter:
                                                                  • Allow editing
                                                                  Validation:
                                                                  • Only during data entry
                                                                  Storage:
                                                                  • Repetitions: 1
                                                                  • Indexing: All
                                                                  • Index Language: German

                                                                      Table Name: Attachment - 5 Fields
                                                                      Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                                                      NameNormal, TextAuto-Enter:
                                                                      • Allow editing
                                                                      Validation:
                                                                      • Only during data entry
                                                                      Storage:
                                                                      • Repetitions: 1
                                                                      • Indexing: None
                                                                      • Automatically create indexes as needed
                                                                      • Index Language: German
                                                                          TypeNormal, TextAuto-Enter:
                                                                          • Allow editing
                                                                          Validation:
                                                                          • Only during data entry
                                                                          Storage:
                                                                          • Repetitions: 1
                                                                          • Indexing: None
                                                                          • Automatically create indexes as needed
                                                                          • Index Language: German
                                                                              ContainerNormal, BinaryAuto-Enter:
                                                                              • Allow editing
                                                                              Validation:
                                                                              • Only during data entry
                                                                              Storage:
                                                                              • Repetitions: 1
                                                                                  PathNormal, TextAuto-Enter:
                                                                                  • Allow editing
                                                                                  Validation:
                                                                                  • Only during data entry
                                                                                  Storage:
                                                                                  • Repetitions: 1
                                                                                  • Indexing: None
                                                                                  • Automatically create indexes as needed
                                                                                  • Index Language: German
                                                                                      EmailIDNormal, NumberAuto-Enter:
                                                                                      • Allow editing
                                                                                      Validation:
                                                                                      • Only during data entry
                                                                                      Storage:
                                                                                      • Repetitions: 1
                                                                                      • Indexing: All
                                                                                      • Index Language: German

                                                                                          Relationship: EMail=Attachment

                                                                                          Table OccurrenceEMailAttachment
                                                                                          FieldEmailID=EmailID
                                                                                          Source TableEMailAttachment
                                                                                          Source FileBuild and send HTML Email with inline graphics.fmp12Build and send HTML Email with inline graphics.fmp12
                                                                                          Allow creation of records via this relationshipOffOff
                                                                                          Delete related records in this table when a record is deleted in the other tableOffOff
                                                                                          Sort records

                                                                                          Off

                                                                                          Off

                                                                                          Layouts

                                                                                          Layout Hierarchy

                                                                                          EMail
                                                                                          Recipient
                                                                                          Attachment


                                                                                          Layout NameInclude In MenuQuick Find# of ObjectsShow Records FromSave record changes automaticallyShow field frames when record is activeShow field frames only on current recordShow current record indicator in List ViewUsed in ScriptsCustom Menu SetScript TriggersTheme ID
                                                                                          EMailYesYes EMailOnOnOffOn [File Default]01
                                                                                          RecipientYesYes RecipientOnOnOffOn [File Default]01
                                                                                          AttachmentYesYes AttachmentOnOnOffOn [File Default]01

                                                                                          Layout Objects: EMail

                                                                                          Regular Fields

                                                                                          Field Name: EMail::SMTP Server
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 12 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 26 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          No

                                                                                          Field Name: EMail::SMTP Username
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 48 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 62 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          No

                                                                                          Field Name: EMail::SMTP Password
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 66 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 80 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          No

                                                                                          Field Name: EMail::Subject
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 96 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 110 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::FromName
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 114 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 128 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::PlainText
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 300 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 422 pt
                                                                                          • Right: 553 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::HTMLText
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 426 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 548 pt
                                                                                          • Right: 553 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::EmailID
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 96 pt
                                                                                          • Left: 468 pt
                                                                                          • Bottom: 110 pt
                                                                                          • Right: 547 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Recipient::Type
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 175 pt
                                                                                          • Left: 13 pt
                                                                                          • Bottom: 190 pt
                                                                                          • Right: 190 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Recipient::Name
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 175 pt
                                                                                          • Left: 191 pt
                                                                                          • Bottom: 190 pt
                                                                                          • Right: 367 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Recipient::Email
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 175 pt
                                                                                          • Left: 368 pt
                                                                                          • Bottom: 190 pt
                                                                                          • Right: 545 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Attachment::Name
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 571 pt
                                                                                          • Left: 19 pt
                                                                                          • Bottom: 585 pt
                                                                                          • Right: 151 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Attachment::Type
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 571 pt
                                                                                          • Left: 152 pt
                                                                                          • Bottom: 585 pt
                                                                                          • Right: 285 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Attachment::Container
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 571 pt
                                                                                          • Left: 286 pt
                                                                                          • Bottom: 585 pt
                                                                                          • Right: 418 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          No

                                                                                          Field Name: Attachment::Path
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 571 pt
                                                                                          • Left: 419 pt
                                                                                          • Bottom: 585 pt
                                                                                          • Right: 551 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::FromEmail
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 132 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 146 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::EmailSource
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 108 pt
                                                                                          • Left: 564 pt
                                                                                          • Bottom: 716 pt
                                                                                          • Right: 979 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::DebugInput
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 108 pt
                                                                                          • Left: 984 pt
                                                                                          • Bottom: 380 pt
                                                                                          • Right: 1285 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::DebugMessages
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 402 pt
                                                                                          • Left: 984 pt
                                                                                          • Bottom: 716 pt
                                                                                          • Right: 1285 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: EMail::Recipient
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 726 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 740 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: Default for Data Type
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Group Buttons

                                                                                          Button PropertiesCoordinatesScript/Script Step
                                                                                            Type:
                                                                                          • Text: Build Email
                                                                                            Additional Properties:
                                                                                          • Change to hand cursor over button
                                                                                          • Rectangular
                                                                                          • Top: 36 pt
                                                                                          • Left: 564 pt
                                                                                          • Bottom: 61 pt
                                                                                          • Right: 721 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Perform Script [ “Build Email” ]

                                                                                          Scripts:


                                                                                          Button PropertiesCoordinatesScript/Script Step
                                                                                            Type:
                                                                                          • Text: Send Email
                                                                                            Additional Properties:
                                                                                          • Change to hand cursor over button
                                                                                          • Rectangular
                                                                                          • Top: 36 pt
                                                                                          • Left: 732 pt
                                                                                          • Bottom: 61 pt
                                                                                          • Right: 889 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Perform Script [ “Send Email” ]

                                                                                          Scripts:


                                                                                          Portals

                                                                                          Portal PropertiesCoordinatesFieldsOptions
                                                                                          • Top: 174 pt
                                                                                          • Left: 12 pt
                                                                                          • Bottom: 295 pt
                                                                                          • Right: 547 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Objects
                                                                                          • Sort records: Off
                                                                                          • Filter calculation: None
                                                                                          • Initial Row: 1
                                                                                          • Number of Rows: 7

                                                                                          Portal PropertiesCoordinatesFieldsOptions
                                                                                          • Top: 570 pt
                                                                                          • Left: 18 pt
                                                                                          • Bottom: 715 pt
                                                                                          • Right: 553 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Objects
                                                                                          • Sort records: Off
                                                                                          • Filter calculation: None
                                                                                          • Initial Row: 1
                                                                                          • Number of Rows: 9

                                                                                          Layout Objects: Recipient

                                                                                          Regular Fields

                                                                                          Field Name: Recipient::Type
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 24 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 38 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Drop-down List
                                                                                          • Display values from: RecipientTypes
                                                                                          • Auto-complete using value list
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Recipient::Name
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 42 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 56 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Recipient::Email
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 60 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 74 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Recipient::EmailID
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 77 pt
                                                                                          • Left: 139 pt
                                                                                          • Bottom: 91 pt
                                                                                          • Right: 392 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Layout Objects: Attachment

                                                                                          Regular Fields

                                                                                          Field Name: Attachment::Name
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 24 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 38 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Attachment::Type
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 42 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 56 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Attachment::Container
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 60 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 185 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          No

                                                                                          Field Name: Attachment::Path
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 186 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 200 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Field Name: Attachment::EmailID
                                                                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                          • Top: 204 pt
                                                                                          • Left: 138 pt
                                                                                          • Bottom: 218 pt
                                                                                          • Right: 391 pt
                                                                                          • Anchoring: Left, Top
                                                                                          Field Format:
                                                                                          • Edit Box
                                                                                          Field Behavior:
                                                                                          • Allow field to be entered: In Find mode, In Browse mode
                                                                                          • Touch keyboard type: System Default
                                                                                          • Go to next field using: Tab key
                                                                                          Yes

                                                                                          Value Lists

                                                                                          Value List NameSourceValuesOn Layouts
                                                                                          RecipientTypesCustom
                                                                                          • TO, CC, BCC, ReplyTo

                                                                                          Script Hierarchy

                                                                                          Run
                                                                                          Build Email
                                                                                          Send Email
                                                                                          Clean Logs

                                                                                          Next Script: [Build Email]
                                                                                          Script NameRun
                                                                                          Run script with full access privilegesOff
                                                                                          Include In MenuNo
                                                                                          Layouts that use this script
                                                                                            Scripts that use this script
                                                                                            Script Definition
                                                                                            Script Steps
                                                                                            • Set Variable [ $r; Value:MBS("Trace") ]
                                                                                            • Set Variable [ $SendEmail; Value:Get(ScriptParameter) ]
                                                                                            • # Build HTML by replacing placeholder with name of recipient
                                                                                            • Set Variable [ $html; Value:EMail::HTMLText ]
                                                                                            • Set Variable [ $name; Value:EMail::Recipient ]
                                                                                            • Set Variable [ $name; Value:MBS("Text.EncodeToHTML"; $name) ]
                                                                                            • Set Variable [ $html; Value:Substitute($html; "%name%"; $name) ]
                                                                                            • # Build Email
                                                                                            • Set Variable [ $EmailID; Value:MBS("SendMail.CreateEmail") ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetFrom"; $EmailID; EMail::FromEmail; EMail::FromName) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetHTMLText"; $EmailID; $html) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetPlainText"; $EmailID; EMail::PlainText) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetSubject"; $EmailID; EMail::Subject) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetSMTPServer"; $EmailID; EMail::SMTP Server) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetSMTPUsername"; $EmailID; EMail::SMTP Username) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.SetSMTPPassword"; $EmailID; EMail::SMTP Password) ]
                                                                                            • # Add Recipients
                                                                                            • Go to Related Record [ From table: “Recipient”; Using layout: “Recipient” (Recipient) ] [ Show only related records ]
                                                                                            • Go to Record/Request/Page [ First ]
                                                                                            • Loop
                                                                                            • If [ Recipient::Type = "To" ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.AddTO"; $EmailID; Recipient::Email; Recipient::Name) ]
                                                                                            • Else If [ Recipient::Type = "CC" ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.AddCC"; $EmailID; Recipient::Email; Recipient::Name) ]
                                                                                            • Else If [ Recipient::Type = "BCC" ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.AddBCC"; $EmailID; Recipient::Email; Recipient::Name) ]
                                                                                            • End If
                                                                                            • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                            • End Loop
                                                                                            • Go to Related Record [ From table: “EMail”; Using layout: “EMail” (EMail) ]
                                                                                            • # Add Attachments
                                                                                            • Go to Related Record [ From table: “Attachment”; Using layout: “Attachment” (Attachment) ] [ Show only related records ]
                                                                                            • Go to Record/Request/Page [ First ]
                                                                                            • Loop
                                                                                            • If [ not IsEmpty(Attachment::Container) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.AddAttachmentContainer"; $EmailID; Attachment::Container; Attachment::Name; Attachment::Type; "79680F27-98FD-4E86-99D5-54D40E5536B5/" & Attachment::Name) ]
                                                                                            • End If
                                                                                            • If [ not IsEmpty(Attachment::Path) ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.AddAttachmentFile"; $EmailID; Attachment::Path; Attachment::Name; Attachment::Type; "79680F27-98FD-4E86-99D5-54D40E5536B5/" & Attachment::Name) ]
                                                                                            • End If
                                                                                            • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                            • End Loop
                                                                                            • Go to Related Record [ From table: “EMail”; Using layout: “EMail” (EMail) ]
                                                                                            • # Show Email
                                                                                            • Set Field [ EMail::EmailSource; MBS( "String.ReplaceNewline"; MBS("SendMail.GetSource"; $EmailID); 1) ]
                                                                                            • # Send Email
                                                                                            • If [ $SendEmail ]
                                                                                            • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.PrepareCURL"; $EmailID; $curl) ]
                                                                                            • #Maybe use alternative SMTP port?
                                                                                            • // Set Variable [ $r; Value:MBS("CURL.SetOptionPort"; $curl; 587) ]
                                                                                            • #This turns TLS on and requires connection to be encrypted
                                                                                            • Set Variable [ $r; Value:MBS("CURL.SetOptionUseSSL"; $curl; 3) ]
                                                                                            • #force TLS v1.2
                                                                                            • Set Variable [ $r; Value:MBS("CURL.SetOptionSSLVersion"; $curl; 6) ]
                                                                                            • #This disables certificate verification, so we accept any:
                                                                                            • Set Variable [ $r; Value:MBS("CURL.SetOptionSSLVerifyHost"; $curl; 0) ]
                                                                                            • Set Variable [ $r; Value:MBS("CURL.SetOptionSSLVerifyPeer"; $curl; 0) ]
                                                                                            • #Better with certificates if you have some:
                                                                                            • // Set Variable [ $r; Value:MBS( "CURL.SetOptionCAInfo"; $curl; "/Library/FileMaker Server/certificates.pem") ]
                                                                                            • // Set Variable [ $r; Value:MBS("CURL.SetOptionSSLVerifyHost"; $curl; 2) ]
                                                                                            • // Set Variable [ $r; Value:MBS("CURL.SetOptionSSLVerifyPeer"; $curl; 1) ]
                                                                                            • #Run the transfer
                                                                                            • Set Variable [ $r; Value:MBS("CURL.Perform"; $curl) ]
                                                                                            • #get debug messages
                                                                                            • Set Field [ EMail::DebugInput; MBS("Text.ReplaceNewline";MBS("CURL.GetInputAsText"; $curl); 1) ]
                                                                                            • Set Field [ EMail::DebugMessages; MBS("CURL.GetDebugMessages"; $curl; "UTF-8") ]
                                                                                            • Set Variable [ $r; Value:MBS("CURL.Release"; $curl) ]
                                                                                            • End If
                                                                                            • # Cleanup
                                                                                            • Set Variable [ $r; Value:MBS("SendMail.Release"; $EmailID) ]
                                                                                            Fields used in this script
                                                                                            Scripts used in this script
                                                                                              Layouts used in this script
                                                                                              Tables used in this script
                                                                                              Table occurrences used by this script
                                                                                              Custom Functions used by this script
                                                                                                Custom menu set used by this script

                                                                                                  Previous Script: [Run]Next Script: [Send Email]
                                                                                                  Script NameBuild Email
                                                                                                  Run script with full access privilegesOff
                                                                                                  Include In MenuYes
                                                                                                  Layouts that use this script
                                                                                                  Scripts that use this script
                                                                                                    Script Definition
                                                                                                    Script Steps
                                                                                                    • Perform Script [ “Run”; Parameter: 0 ]
                                                                                                    Fields used in this script
                                                                                                      Scripts used in this script
                                                                                                      Layouts used in this script
                                                                                                        Tables used in this script
                                                                                                          Table occurrences used by this script
                                                                                                            Custom Functions used by this script
                                                                                                              Custom menu set used by this script

                                                                                                                Previous Script: [Build Email]Next Script: [Clean Logs]
                                                                                                                Script NameSend Email
                                                                                                                Run script with full access privilegesOff
                                                                                                                Include In MenuYes
                                                                                                                Layouts that use this script
                                                                                                                Scripts that use this script
                                                                                                                  Script Definition
                                                                                                                  Script Steps
                                                                                                                  • Perform Script [ “Run”; Parameter: 1 ]
                                                                                                                  Fields used in this script
                                                                                                                    Scripts used in this script
                                                                                                                    Layouts used in this script
                                                                                                                      Tables used in this script
                                                                                                                        Table occurrences used by this script
                                                                                                                          Custom Functions used by this script
                                                                                                                            Custom menu set used by this script

                                                                                                                              Previous Script: [Send Email]
                                                                                                                              Script NameClean Logs
                                                                                                                              Run script with full access privilegesOff
                                                                                                                              Include In MenuYes
                                                                                                                              Layouts that use this script
                                                                                                                                Scripts that use this script
                                                                                                                                  Script Definition
                                                                                                                                  Script Steps
                                                                                                                                  • Set Field [ EMail::DebugInput; "" ]
                                                                                                                                  • Set Field [ EMail::DebugMessages; "" ]
                                                                                                                                  • Set Field [ EMail::EmailSource; "" ]
                                                                                                                                  Fields used in this script
                                                                                                                                  Scripts used in this script
                                                                                                                                    Layouts used in this script
                                                                                                                                      Tables used in this script
                                                                                                                                      Table occurrences used by this script
                                                                                                                                      Custom Functions used by this script
                                                                                                                                        Custom menu set used by this script

                                                                                                                                          Download example: Build and send HTML Email with inline graphics

                                                                                                                                          Used functions: