Docs
ServoyCloudSupportSamplesOpen SourceCommunity
  • Home
  • GUIDES
    • Platform Overview
    • Get Servoy
    • Get Started
      • Chapter 0
      • Chapter 1
      • Chapter 2
      • Chapter 3
      • Chapter 4
      • Chapter 5
    • Get Help
      • SuLA Instructions
      • SuLA Terms
    • Develop
      • Application Design
        • Forms
          • Layout Management
            • Simple Layout
            • Fully Responsive
              • Bootstrap 12-Grid
              • Flexbox
              • Custom Div
              • Collapsible Container
              • Simple Collapsible
              • Center Container
              • Inline Group Container
            • Abstract Form
          • Form Containers
            • Form Container
            • Tab Panel
            • Split Pane
            • Collapse
            • Accordion Panel
            • Form Component
            • List Form Component
          • Form Inheritance
          • Form Components
        • UI Components
          • Buttons and Text
            • Badge
            • Button
            • Data Label
            • Dropdown
            • Image
            • Label
          • Grids
            • Data Grid
            • Power Grid
            • Table
          • Input Controls
            • Calendar
            • Calendar Inline
            • Checkbox
            • Choice Group
            • Combobox
            • Group Buttons
            • Html Area
            • Input Group
            • Rating
            • Slider
            • Switch
            • Spinner
            • TextArea
            • Textbox
            • TextBoxGroup
            • Type Ahead
            • select2tokenizer
          • Media
            • Carousel
            • Embedded YouTube
            • File upload
            • Image label
            • Lightbox Gallery
            • MultiFile Upload
            • PDF JS Viewer
            • PDF Viewer
          • Mobile
            • Native Data List
            • Native Select
          • Navigation
            • Breadcrumbs
            • Navbar
            • sidenav
          • Visualization
            • DBTreeview
            • Progress Bar
            • Treeview
            • ChartJS
              • Data Labels Plugin
              • Funnel Chart
              • OutLabels Plugin
              • TreeMap
          • Specialized Components
            • Smart Document Editor
            • Servoy PDF Viewer
            • Fullcalendar Component
              • Fullcalendar
              • Fullcalendar Events
              • Migrating calendar from Smart and Web client to NG client
            • Fullcalendar Component 2
            • Canvas
            • Google Charts
            • Google Maps
            • svySignature
            • svywebcam
        • Styling and Themes
          • Default Theme Properties
          • CSS / LESS
          • Component Variants
          • Font Icons
        • Data Modeling
          • Databases
            • Tables
              • Columns
              • Calculations
              • Aggregations
              • Methods
              • Events / Triggers
              • Table security
            • Views
            • Procedures
          • Relations
          • Value Lists
          • Menus
          • In-Memory Databases
          • View Datasource
        • Modular Design
      • Programming Guide
        • Scripting the UI
          • Scripting Forms
          • Interacting with Components
          • Navigation
          • Windows, Dialogs and Popups
          • Events Manager
        • Working with Data
          • Concepts
          • Loading
          • Sorting
          • Iterating
          • Searching
            • Find mode
            • Query Builder
            • SQL String
          • Filtering
          • Editing
          • Validation
        • Automation and Scheduling
          • Batch Processor
          • Headless API
          • Scheduler API
        • Creating REST APIs
        • Consuming Webservices
        • Working with Files
          • File Plugin Basics
          • Images
          • Excel
          • PDF
          • JSON
        • Browser Utilities
          • Notifications
            • Web Notifications (Toastr)
            • Web Notifications (Native)
            • Block UI
          • Session Management
          • Keyboard Utilities
          • NG Utils
        • Sending and Receiving Email
        • Servoy Jasper Reports
          • Input Type
          • Display Mode
          • Output format
          • Jaspe Reports Viewer
        • Extensions
          • Modules
            • svyPhonegap
              • First Use Guide
              • Barcode Scanner
              • Browser
              • Camera
              • File
              • Fingerprint
              • Location
              • Network Interface
              • Phonegap
              • Printer
              • Push Notifications
            • svyAPI
              • Getting Started
            • svyLookup
              • Custom Templates
              • API Documentation
              • svyLookup v1
                • API Documentation v1.0.0
                • Base Form svyLookupTable v1.0.0
                • Base Form AbstractLookup v1.0.0
            • svyNavigation
              • API Documentation
                • API svyNavigation
                • API svyNavigationHistory
                • API svyNavigationUX
            • svyPopupFilter
              • Simple Filter Pickers
              • Custom Templates
              • API Documentation
                • API svyToolbarFilter
                • API svyPopupFilter
              • API Documentation v1
                • API svyToolbarFilter v1
                • API svyPopupFilter v1
            • svySearch
            • svySecurity
              • Overview
              • Token-based Auth and SSO (NEW!)
              • API Documentation
              • Getting Started
              • Tenant replication
              • Security Management Console
                • Classic Security Management Console
              • svySecurityUX
              • svyProperties
              • API Doc svyProperties
            • svyUtils
              • Log Manager
              • Log Manager Appenders
              • Smart Doc Editor Utils
              • Custom Dialogs
              • Excel Utils
                • Full API Reference
              • Crypto Utils
      • Security
        • Authentication
        • Permissions
          • UI Permissions
          • Data Permissions
          • Runtime Permissions
        • Audit Logging
        • OAuth
        • JWT
      • Multi-Language Support
      • Mobile Development
        • Getting Started
        • Mobile Design
        • Native Mobile Integrations
        • Building a Native Binary for the App Store
      • Native Desktop Development
        • NGDesktop UI plugin
        • NGDesktop Utils
        • NGDesktop File Plugin
    • Deploy
      • WAR Deployment
      • Docker Deployment
      • Server Configuration
        • Server Settings
        • Server Plugins
        • Database Servers
          • Locks
          • Transactions
          • Oracle
          • SQLServer
        • Client Sessions
        • Batch Processors
        • License Management
        • Monitoring
          • Server Log
          • Browser Console Log
          • Websocket Log
          • Query Performance
          • Client Performance
          • Client Event Tracing
          • Monitoring Servoy with JMX
      • NGClient deployment
      • Troubleshooting
      • Other Topics
        • Security: Cross-site Scripting
        • Running in an iFrame
    • Extend
    • Contribute
  • Reference
    • Servoy Core
      • Object Model
        • Database Server
          • Table
            • Column
            • Calculation
            • Method
            • Aggregation
          • View
          • Procedure
        • Solution
          • Form
          • Form Component
          • Relation
          • Relation Item
          • Table Node
          • Value List
          • Menu
          • Menu item
          • In-Memory Data Source
          • View Foundset Data Source
          • Variable
          • Column Info
          • Media
          • Layout Container
          • Method
        • i18n Message Key
      • Developer API
        • Globals
        • Forms
          • RuntimeForm
            • controller
            • containers
              • RuntimeContainer
            • elements
              • Component
              • RuntimeAccordionPanel
              • RuntimeBean
              • RuntimeButton
              • RuntimeCalendar
              • RuntimeCheck
              • RuntimeCombobox
              • RuntimeComponent
              • RuntimeDataButton
              • RuntimeDataLabel
              • RuntimeGroup
              • RuntimeHtmlArea
              • RuntimeImageMedia
              • RuntimeInsetList
              • RuntimeLabel
              • RuntimeListBox
              • RuntimePassword
              • RuntimePortal
              • RuntimeRadio
              • RuntimeChecks
              • RuntimeRadios
              • RuntimeRectangle
              • RuntimeRtfArea
              • RuntimeSpinner
              • RuntimeSplitPane
              • RuntimeTabPanel
              • RuntimeTextArea
              • RuntimeTextField
              • RuntimeWebComponent
        • JS Lib
          • Array
          • BigInt
          • Boolean
          • Date
          • Function
          • IterableValue
          • Iterator
          • JSON
          • Map
          • Set
          • Math
          • Namespace
          • Number
          • Object
          • Promise
          • QName
          • RegExp
          • Special Operators
          • Statements
          • String
          • XML
          • XMLList
        • Application
          • APPLICATION_TYPES
          • CLIENTDESIGN
          • DRAGNDROP
          • ELEMENT_TYPES
          • LOGGINGLEVEL
          • NGCONSTANTS
          • UICONSTANTS
          • CSSPosition
          • JSDimension
          • JSDNDEvent
          • JSEvent
          • JSLogger
          • JSLogBuilder
          • JSPoint
          • JSUpload
          • JSWindow
          • JSBounds
          • Renderable
          • UUID
        • SolutionModel
          • ALIGNMENT
          • ANCHOR
          • BEVELTYPE
          • CURSOR
          • DEFAULTS
          • FONTSTYLE
          • MEDIAOPTION
          • PAGEORIENTATION
          • PRINTSLIDING
          • SCROLLBAR
          • TITLEJUSTIFICATION
          • TITLEPOSITION
          • UNITS
          • JSBean
          • JSButton
          • JSCalculation
          • JSComponent
          • JSDataSourceNode
          • JSField
          • JSForm
          • JSLabel
          • JSMedia
          • JSMethod
          • JSPart
          • JSPortal
          • JSRelation
          • JSRelationItem
          • JSStyle
          • JSTab
          • JSTabPanel
          • JSValueList
          • JSVariable
          • JSTitle
          • JSChecks
          • JSCombobox
          • JSHeader
          • JSInsetList
          • JSList
          • JSPassword
          • JSRadios
          • JSText
          • JSTextArea
          • JSWebComponent
          • JSLayoutContainer
        • Database Manager
          • QUERY_COLUMN_TYPES
          • SQL_ACTION_TYPES
          • JSColumn
          • JSDataSet
          • JSBaseRecord
          • JSBaseSqlRecord
          • JSBaseFoundset
          • JSBaseSQLFoundset
          • JSFoundSet
          • JSFoundSetUpdater
          • JSRecord
          • JSRecordMarker
          • JSRecordMarkers
          • JSTable
          • JSTableFilter
          • MenuFoundSet
          • MenuItemRecord
          • QBAggregate
          • QBAggregates
          • QBCase
          • QBCaseWhen
          • QBColumn
          • QBColumns
          • QBCondition
          • QBFunction
          • QBFunctions
          • QBGroupBy
          • QBJoin
          • QBJoins
          • QBLogicalCondition
          • QBParameter
          • QBParameters
          • QBPart
          • QBResult
          • QBSearchedCaseExpression
          • QBSelect
          • QBSort
          • QBSorts
          • QBTableClause
          • QBWhereCondition
          • ViewFoundSet
          • ViewRecord
        • Events Manager
          • EVENTS_AGGREGATION_TYPES
          • EventType
        • Menus
          • JSMenu
          • JSMenuItem
        • JSMenuDatasource
        • Utils
        • Client Utils
          • JSBlobLoaderBuilder
        • History
        • Security
        • i18n
        • ServoyException
          • DataException
        • JSUnit
        • Datasources
          • DBDataSource
          • DBDataSourceServer
          • JSConnectionDefinition
          • JSDataSource
          • MemDataSource
          • MenuDataSource
          • SPDataSource
          • SPDataSourceServer
          • ViewDataSource
        • JSViewDatasource
        • servoyDeveloper
        • enum
    • Extensions
      • UI Components
        • Buttons and Text
          • Badge
          • Button
          • Data Label
          • Drop Down
          • Image
          • Label
        • Form Containers
          • Accordion Panel
          • Collapse
          • Form Container
          • Form Component Container
          • List Form Component
          • Default Loading Indicator
          • Error Bean
          • Portal
          • Responsive Container
          • Servoy Default Navigator
          • Slider
          • Split Pane
          • TabPanel
        • Grids
          • Data Grid
          • Power Grid
          • Table
        • Input Controls
          • Calendar
          • Calendar Inline
          • Checkbox
          • Choice Group
          • Combobox
          • Floatinglabel Calendar
          • Floatinglabel Combobox
          • Floatinglabel Textarea
          • Floatinglabel Textbox
          • Floatinglabel Type Ahead
          • Group Buttons
          • Html Area
          • Input Group
          • Rating
          • Select2tokenizer
          • Slider
          • Spinner
          • Switch
          • TextArea
          • TextBox
          • TextBox Group
          • Type Ahead
        • Media
          • Carousel
          • Embedded YouTube
          • File upload
          • Image label
          • Lightbox Gallery
          • MultiFile Upload
          • PDF JS Viewer
          • PDF Viewer
        • Mobile
          • Native Data List
          • Native Select
        • Navigation
          • Breadcrumbs
          • Navbar
          • sidenav
        • SmartDocEditor
          • Smart Document Editor
        • Visualization
          • Canvas
          • Chart
          • Custom List
          • DBTreeview
          • Foundset List
          • Fullcalendar
          • Gauge
          • Google Maps
          • Kanban
          • Progress Bar
          • Treeview
      • Server Plugins
        • amortization
          • AmortizationCalculation
          • Polynomial
        • clientmanager
          • Broadcaster
          • JSClientInformation (cm)
        • excelxport
        • file
          • JSFile
          • JSProgressMonitor
        • headlessclient
          • JSClient
        • http
          • HTTP_STATUS
          • Cookie
          • DeleteRequest
          • GetRequest
          • HeadRequest
          • HttpClient
          • HttpClientConfig
          • OptionsRequest
          • PostRequest
          • PutRequest
          • Response
          • TraceRequest
          • PatchRequest
          • JSFileUpload
        • images
          • JSImage
        • jwt
          • Algorithm
          • Builder
          • JWTClaims
        • mail
          • Attachment
          • MailMessage
        • maintenance
          • JSClientInformation
          • JSColumnObject
          • JSServer
          • JSTableObject
        • mobileservice
          • OfflineDataDescription
        • oauth
          • ClientAuthentication
          • CustomApiBuilder
          • OAuthProviders
          • OAuthRequest
          • OAuthResponse
          • OAuthResponseBinary
          • OAuthResponseJSON
          • OAuthResponseText
          • OAuthService
          • OAuthServiceBuilder
          • OAuthTokenExtractors
          • RequestType
        • pdf_output
        • rawSQL
        • RestWs plugin
        • rest_ws
          • WsContents
          • WsCookie
          • WsRequest
          • WsResponse
        • scheduler
        • serialize
        • textxport
          • DataProviderExport
          • TabExporter
        • udp
          • JSPacket
        • XmlReader
          • XmlNode
      • Browser Plugins
        • Block UI
        • Block UI (ref)
        • Dialogs Plugin
        • Idle
        • Idle (ref)
        • Key Listener
        • Key Listener (ref)
        • NGDesktop File
        • NGDesktop File (ref)
        • NGDesktop UI (ref)
        • NGDesktop Utils (ref)
        • NG Utils (ref)
        • Office Javascript API for Servoy
        • Phonegap
        • Web Notifications (Native)
        • Web Notifications (Toastr)
        • Window Plugin
        • Font Awesome
      • Modules
        • Smart Doc Editor Utils
        • svyAPI
          • Getting Started
        • svyLookup
          • Custom Templates
          • API Documentation
          • svyLookup v1
            • API Documentation v1.0.0
            • Base Form svyLookupTable v1.0.0
            • Base Form AbstractLookup v1.0.0
        • svyLookupExample
        • svyNavigation
          • API Documentation
            • API svyNavigation
            • API svyNavigationHistory
            • API svyNavigationUX
        • svyNavigationUX
        • svyNavigationUXSample
        • svyPopupFilter
          • Simple Filter Pickers
          • Custom Templates
          • API Documentation
            • API svyToolbarFilter
            • API svyPopupFilter
          • API Documentation v1
            • API svyToolbarFilter v1
            • API svyPopupFilter v1
        • svyProperties
        • svySearch
        • svySecurity
          • Overview
          • Token-based Auth and SSO (NEW!)
          • API Documentation
          • Getting Started
          • Tenant replication
          • Security Management Console
            • Classic Security Management Console
          • svySecurityUX
          • svyProperties
          • API Doc svyProperties
        • svySecurityConsole
        • svySecurityUX
        • svyUtils
          • Log Manager
          • Log Manager Appenders
          • Smart Doc Editor Utils
          • Custom Dialogs
          • Excel Utils
          • Full API Reference
          • Crypto Utils
        • svyUtils$Excel
        • svyUtils$NGClient
        • svyUtils$customDialogs
        • svyUtils$logManagerAppenders
        • svyUtils$tableGrid
      • Layout
        • Boostrap 12grid layout
          • Collapsible Container
          • Simple Collapsible
          • Center Container
          • Inline Group Container
          • Flexbox Layout
      • Solutions
        • Sample Application
          • Tutorial Part 1
          • Tutorial Part 2
      • Packages
        • UI Component Packages
          • Advanced Renderers
          • Bootstrap Components
          • Bootstrap Extra Components
          • Canvas
          • Chart JS
          • Fullcalendar Component
          • googlemaps
          • kanban
          • Servoy Core
          • Servoy Extra Components
          • Servoy NG-Grids
          • Servoy PDF Viewer
          • smartDocumentEditor
        • Browser Plugin Packages
          • Block UI
          • Core NG only Services
          • Key Listener
          • NGDesktop File
          • NGDesktop UI
          • NGDesktop Utils
          • Web Notifications
          • Idle Web Service
    • Servoy Developer
      • Menu
        • File
        • Edit
        • Source
        • Refactor
        • Navigate
        • Search
        • Project
        • Actions
        • Run
        • Window
        • Help
      • Toolbar
      • Solution Explorer
        • Resources
          • Database Servers
            • Database Server
              • Procedures
              • Tables
              • Views
          • Security
          • i18n
        • All Solutions
          • Solution
          • Active Solution
            • Scopes
              • Scope
                • Variables
            • Forms
              • Working Set
              • Form
                • Controller
                • Variables
                • Elements
                • Relations
            • Form Components
              • Form Component
            • Relations
              • Relation
            • ValueLists
              • ValueList
            • Menus
              • Menu
                • MenuItem
            • Media
              • Folder
              • File
            • DataSources
              • In Memory DataSources
                • In Memory DataSource
              • View Foundsets DataSources
                • View Foundset DataSources
            • Servoy Packages
              • Package
            • Modules
              • Module
        • Solution Explorer Contextual List
      • Views
        • Command Console
        • Console
        • Problems
        • Tasks
        • Bookmarks
        • Search
        • Form Hierarchy
        • Help
        • JUnit
        • Outline
        • Profiler
        • Properties
        • Project Explorer
        • Call Hierarchy
      • Editors and Wizards
        • Property configurator for columns
        • Relation Editor
        • Text Format Editor
        • Date Format Editor
        • Number Format Editor
        • Database Synchronization Wizard
        • Security Editor
        • SQL Editor
        • i18n Editor
        • File Import Wizard
        • File Export Wizard
        • WAR Export Wizard
        • NGDesktop Export Wizard
        • Table Editor
        • Metadata Synchronization Wizard
        • Database Server Connection Editor
        • Text Property Editor
        • Valuelist Editor
        • Form Editor
          • Parts of the Form Editor
          • Designing a Form
          • Layout Tools
          • Using Containers
          • Creating and Using Forms
          • Using Servoy Beans
          • Using Shapes
          • Form Editor Subtabs
          • [Tips and Shortcuts][reference/servoy-developer/object-editors/form-editor-tips_and_shortcuts.md]
          • Editong a Responsive LayoutForm
          • CSS Positioning
        • Form Hierarchy
        • Component Properties Editor
        • Variable Editor
        • Method Selection Wizard
        • New Solution Wizard
        • Application Event Types Editor
        • New Form Wizard
        • Form Dataproviders Configurator
        • Servoy Resource Locator
        • Datasource Selection Wizard
        • Sorting Fields Wizard
        • Scripting Editor
          • Getting Started-Overview of Script Editor
          • Code Writing Features
          • Code Navigation
          • Code Rewriting Tools
          • Refactoring
          • Code Formatting
          • Script Editor Tips and Shortcuts
          • Unit Tests
        • Theme Editor
          • General Properties
          • Sidenav Properties
          • Navbar Properties
          • Tabs Properties
          • Windows Properties
          • Dialogs Properties
          • Tables Properties
          • Breadcrumb specific style Properties
          • Brand colors Properties
          • Validations Properties
          • Margins and Padding Properties
        • Editor Selection
        • Run Configurations
        • Debug Configurations
        • Externalize Strings Wizard
        • Font Chooser Wizard
        • Color Chooser Wizard
        • Project Properties Configurator
        • Move Wizard
        • External Tools Configurations
        • About Servoy Developer
        • Servoy Developer Installation Details
        • Eclipse Marketplace Wizard
        • Install Available Software Wizard
        • Cheat Sheet Selection Wizard
        • Servoy Developer Help Wizard
        • Switch to Editor Wizard
        • Find Actions Wizard
        • Customize Perspective Configurator
        • Quick Search Wizard
        • Search Wizard
        • Encoding Wizard
        • Task Wizard
        • Find - Replace Wizard
        • Properties Editor
        • New Project Wizard
        • New Method Wizard
        • New Menu Wizard
          • New MenuItem Wizard
        • Menu Editor
        • ServoyMenu Selection Wizard
        • JSMenu compatible component selector
        • Permissions Configuration Dialog
      • Project File Structure
        • Servoy Installation Directory
          • servoy.properties
        • Workspace Folder
          • Resources Directory
            • Database Information (.dbi) Files
          • Solution Folder
      • Package Manager
      • Preferences
      • Property Types for components / services
      • Debugger
        • Debug Explorer
        • Breakpoints
          • Breakpoint Properties
        • Variables
        • Expressions
        • Interactive Console
    • Application Server
    • Servoy Cloud
      • Cloud Control Center
        • Home
          • Setup Namespace
          • User profile
            • My Profile
            • Support
        • Download IDE
        • Application Overview
          • Applications
            • Pipelines
              • Jobs
                • Packages
                  • Commits
                  • Artifacts
                  • Configuration
                  • Quality reports
                  • Build markers
                • Job Configuration
                  • Build and Deploy or Build
                  • Mobile
                  • Desktop
            • Environments
              • Metrics
                • Users
                • Databases
                  • Metrics
                • System Health
                • Log Activity
                • App performance
                • Query performance
              • Cloud reporting
            • Security
              • Permissions
              • Tenants
            • Reports
            • Security Login Designer
              • Single Sign-On
                • Sign in with Google
                • Sign in with Microsoft
          • Code Repositories
        • Project Management
          • Tickets
          • Backlog
          • Active Sprints
        • User Management
          • Users
          • Roles
        • Administration
          • Security
            • ServoyCloud Roles
          • Credentials
          • Settings
        • Add-Ons
      • Database Backup
      • E2E Cypress Testing
        • Using Cypress
      • On-Premise Deployment
      • Privacy policy (ServoyAI)
      • FAQ
      • Migrate to Servoy Cloud
    • Extensions Developement
      • Component and Services
        • Component Development
        • Service Development
        • Tools and Dev Tips to use for Component/Service developement
        • Manifest (.mf file)
        • Specification (.spec file)
          • Property Types
            • Array property types
            • Custom object property types
            • Findmode property type
            • Foundset property type
            • Tags
        • Directives And Filters
          • Sablotabsequence
        • Console (serverside)
        • ServoyApi (serverside)
      • Serverside Plugins
        • Data Convertors and Validators
        • UI Convertors
  • Release notes
    • Release notes
      • 2025.03
      • 2024.03 (LTS)
      • 2023.03 (LTS)
      • 2025.03 (Servoy Cloud)
      • 2024.12
      • 2024.12 (Servoy Cloud)
      • 2024.09
      • 2024.09 (Servoy Cloud)
      • 2024.06
      • 2024.06 (Servoy Cloud)
      • 2024.03 (Servoy Cloud)
      • 2023.12
      • 2023.12 (Servoy Cloud)
      • 2023.09
      • 2023.09 (Servoy Cloud)
      • 2023.06
      • 2022.03 (LTS)
      • 2022.12 What's new
      • 2022.12
      • 2022.09 What's new
      • 2022.09
      • 2022.06 What's new
      • 2022.06
      • 2021.03.3 (LTS)
Powered by GitBook
On this page
  • Overview
  • Returned Types
  • Properties Summarized
  • Methods Summarized
  • Properties Detailed
  • from
  • Methods Detailed
  • createBinaryAttachment(filename, binarydata)
  • createBinaryAttachment(filename, binarydata, mimeType)
  • createTextAttachment(filename, textdata)
  • createTextAttachment(filename, textdata, mimeType)
  • getLastSendMailExceptionMsg()
  • getMailMessage(binaryblob/string)
  • getPlainMailAddresses(addressesString)
  • isValidEmailAddress(email)
  • receiveMail(username, password, leaveMsgsOnServer)
  • receiveMail(username, password, leaveMsgsOnServer, receiveMode)
  • receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate)
  • receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host)
  • receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties)
  • sendBulkMail(to, from, subject, msgText)
  • sendBulkMail(to, from, subject, msgText, cc)
  • sendBulkMail(to, from, subject, msgText, cc, bcc)
  • sendBulkMail(to, from, subject, msgText, cc, bcc, attachment)
  • sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
  • sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
  • sendBulkMail(to, from, subject, msgText, cc, bcc, attachments)
  • sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
  • sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)
  • sendMail(to, from, subject, msgText)
  • sendMail(to, from, subject, msgText, cc)
  • sendMail(to, from, subject, msgText, cc, bcc)
  • sendMail(to, from, subject, msgText, cc, bcc, attachment)
  • sendMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
  • sendMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
  • sendMail(to, from, subject, msgText, cc, bcc, attachments)
  • sendMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
  • sendMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)

Was this helpful?

  1. Reference
  2. Extensions
  3. Server Plugins

mail

PreviousJWTClaimsNextAttachment

Last updated 4 months ago

Was this helpful?

(plugins.mail)

Overview

The mail plugin enables sending and receiving emails, with additional support for attachments, email validation, and property configuration. It supports creating binary and text-based attachments, specifying MIME types, and handling exceptions that occur during mail operations. The plugin can process incoming mail from POP3 accounts, with options for leaving messages on the server, retrieving headers, and filtering by sent date.

Emails can be sent individually or in bulk. Bulk emails are optimized to prevent responses such as "out of office" messages. The plugin supports HTML-formatted messages, multiple recipients, and optional CC/BCC configurations. Additional customization is available through SMTP host settings and override properties. Attachments can be added as single files or arrays, providing flexibility for diverse email content. Utility methods like email address validation and plain address extraction are also available.

Returned Types

,,

Properties Summarized

Type
Name
Summary

Returns the value of the mail.

Methods Summarized

Type
Name
Summary

Creates a binary attachment object.

Creates a binary attachment object.

Creates a text based attachment objec with the default 'text/plain' mimetype

Creates a text based attachment object.

Get the exception that occurred in the last sendMail attempt (null if no exception occurred).

Helper method, returns MailMessage object from binary or 7bits string.

Helper method to only get the plain addresses.

Checks whether the given e-mail address is valid or not.

Receive mails from pop3 account.

Receive mails from pop3 account.

Receive mails from pop3 account.

Receive mails from pop3 account.

Receive mails from pop3 account.

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).

Properties Detailed

from

Returns the value of the mail.from property which is set on the admin page.

Sample

var from = plugins.mail.from

Methods Detailed

createBinaryAttachment(filename, binarydata)

Creates a binary attachment object.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('logo1.gif',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createBinaryAttachment('logo2.gif',plugins.file.readFile('c:/temp/another_logo.gif'));
var success = plugins.mail.sendMail('to_someone@example.com', 'John Cobb <from_me@example.org>', 'subject', 'msgText',null,null,new Array(attachment1,attachment2));
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

createBinaryAttachment(filename, binarydata, mimeType)

Creates a binary attachment object.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('logo1.gif',plugins.file.readFile('c:/temp/a_logo.gif', 'image/gif'));
var attachment2 = plugins.mail.createBinaryAttachment('logo2.gif',plugins.file.readFile('c:/temp/another_logo.gif', 'image/gif'));
var success = plugins.mail.sendMail('to_someone@example.com', 'John Cobb <from_me@example.org>', 'subject', 'msgText',null,null,new Array(attachment1,attachment2));
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

createTextAttachment(filename, textdata)

Creates a text based attachment objec with the default 'text/plain' mimetype

Parameters

Sample

var attachment = plugins.mail.createTextAttachment('readme.html','<html>bla bla bla');
var success = plugins.mail.sendMail('to_someone@example.com', 'John Cobb <from_me@example.com>', 'subject', 'msgText',null,null,attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

createTextAttachment(filename, textdata, mimeType)

Creates a text based attachment object.

Parameters

Sample

var attachment = plugins.mail.createTextAttachment('readme.html','<html>bla bla bla', 'text/html');
var success = plugins.mail.sendMail('to_someone@example.com', 'John Cobb <from_me@example.com>', 'subject', 'msgText',null,null,attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

getLastSendMailExceptionMsg()

Get the exception that occurred in the last sendMail attempt (null if no exception occurred).

Sample

var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.org', 'John Cobb <from_me@example.com>', 'subject', 'my message',null,'unnamed@example.com');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert',plugins.mail.getLastSendMailExceptionMsg(),'OK');
}

getMailMessage(binaryblob/string)

Helper method, returns MailMessage object from binary or 7bits string.

Parameters

Sample

var msg = plugins.mail.getMailMessage(myBlob);
if (msg != null) //if is null error occurred!
{
	application.output(msg.getFromAddresses())
}

getPlainMailAddresses(addressesString)

Helper method to only get the plain addresses.

Parameters

Sample

var plainArray = plugins.mail.getPlainMailAddresses('John Cobb <from_me@example.com>,Pete Cobb<from_pete@example.com>');
application.output(plainArray[0]) //will return 'from_me@example.com'

isValidEmailAddress(email)

Checks whether the given e-mail address is valid or not.

Parameters

Sample

plugins.mail.isValidEmailAddress("me@example.com");

receiveMail(username, password, leaveMsgsOnServer)

Receive mails from pop3 account.

Parameters

Sample

var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
		application.output(msg.getHtmlMsg())
		application.output(msg.getPlainMsg())
		var attachments = msg.getAttachments()
		if (attachments != null)
		{
			for (var j = 0 ; j < attachments.length ; j++)
			{
				var attachment = attachments[j]
				application.output(attachment.getName())
				var attachmentDataByteArray = attachment.getData()
				//write attachmentDataByteArray to a file...
			}
		}
	}
}

receiveMail(username, password, leaveMsgsOnServer, receiveMode)

Receive mails from pop3 account.

Parameters

Sample

var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  0);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
	}
}

receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate)

Receive mails from pop3 account.

Parameters

Sample

//it is also possible to first receive the headers and later receive a full message with particular 'sentdate'
//var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  0,  theSentDateObjectFormPreviousHeaderLoading);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
	}
}

receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host)

Receive mails from pop3 account.

Parameters

Sample

//it is also possible to first receive the headers and later receive a full message
var receiveMode = 0;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var pop3Host = 'myserver.com';
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  receiveMode,  null, pop3Host);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
		application.output(msg.getHtmlMsg())
		application.output(msg.getPlainMsg())
		var attachments = msg.getAttachments()
		if (attachments != null)
		{
			for (var j = 0 ; j < attachments.length ; j++)
			{
				var attachment = attachments[j]
				application.output(attachment.getName())
				var attachmentDataByteArray = attachment.getData()
				//write attachmentDataByteArray to a file...
			}
		}
	}
}

receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties)

Receive mails from pop3 account.

Parameters

Sample

var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS

var properties = new Array();
properties[0] = 'mail.pop3.port=995';
properties[1] = 'mail.pop3.ssl.enable=true';
properties[2] = 'mail.pop3.host=myserver.com';
properties[3] = 'mail.pop3.user=user@myserver.com';

var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  receiveMode,  null, properties);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
	}
}

sendBulkMail(to, from, subject, msgText)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>,replyTo@example.com', 'subject', msgText);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,'cc1@example.com,cc2@example.com');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'bcc1@example.com');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc, attachment)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'bcc1@example.com,bcc2@example.com',attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',attachment,smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',attachment,properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc, attachments)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'bcc1@example.com,bcc2@example.com',[attachment1,attachment2]);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',[attachment1,attachement2],smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)

Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). A bulk email makes it possible for one to not receive "out of office" emails back from receiver.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendBulkMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',[attachment1,attachement2],properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}

sendMail(to, from, subject, msgText)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>,replyTo@example.com', 'subject', msgText);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,'cc1@example.com,cc2@example.com');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'bcc1@example.com');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc, attachment)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'bcc1@example.com,bcc2@example.com',attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',attachment,smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',attachment,properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc, attachments)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'bcc1@example.com,bcc2@example.com',[attachment1,attachment2]);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',[attachment1,attachement2],smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

sendMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)

Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). If you want to have a different reply address than from, you can specify this with the from parameter by adding another email after it.

Parameters

Sample

var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendMail('to_someone@example.com,to_someone_else@example.net', 'John Cobb <from_me@example.com>', 'subject', msgText,null,'unnamed@example.com',[attachment1,attachement2],properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

Type

filename ;

binarydata ;

Returns: an Attachment object created with the specified filename and binary data, or null if the inputs are invalid.

filename ;

binarydata ;

mimeType ;

Returns: an Attachment object created with the specified filename, binary data, and MIME type, or null if the inputs are invalid.

filename ;

textdata ;

Returns: an Attachment object created with the specified filename and text data, using the default MIME type of ‘text/plain’, or null if the inputs are invalid.

filename ;

textdata ;

mimeType ;

Returns: an Attachment object created with the specified filename, text data, and MIME type, or null if the inputs are invalid.

Returns: The exception message from the last sendMail attempt, or null if no exception occurred.

binaryblob/string ;

Returns: a MailMessage object created from the provided binary or string data, or null if an error occurred.

addressesString ;

Returns: an array of plain email addresses extracted from the input string, or an empty array if no valid addresses are found.

email ;

Returns: true if the given email address is valid, false otherwise.

username ;

password ;

leaveMsgsOnServer ;

Returns: an array of MailMessage objects representing received mail, or null if an error occurred.

username ;

password ;

leaveMsgsOnServer ;

receiveMode ;

Returns: an array of MailMessage objects representing received mail, or null if an error occurred.

username ;

password ;

leaveMsgsOnServer ;

receiveMode ;

onlyReceiveMsgWithSentDate ;

Returns: an array of MailMessage objects representing received mail, or null if an error occurred.

username ;

password ;

leaveMsgsOnServer ;

receiveMode ;

onlyReceiveMsgWithSentDate ;

pop3Host ;

Returns: an array of MailMessage objects representing received mail, or null if an error occurred.

username ;

password ;

leaveMsgsOnServer ;

receiveMode ;

onlyReceiveMsgWithSentDate ;

properties ;

Returns: an array of MailMessage objects representing received mail, or null if an error occurred.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

Returns: true if the bulk email is successfully sent to all specified recipients, or false if an error occurs.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

Returns: true if the bulk email, including “cc” recipients, is sent successfully, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

Returns: true if the bulk email is delivered successfully to all specified recipients, including “cc” and “bcc”, or false in case of failure.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachment A single attachment

Returns: true if the bulk email with the specified attachment is sent without issues, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachment A single attachment

smtpHost The smtp host

Returns: true if the bulk email with the specified attachment is sent without issues, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachment A single attachment

overrideProperties An array of properties

Returns: true if the bulk email with the specified attachment is sent without issues, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachments The attachments

Returns: true if the bulk email with the specified attachments is sent without issues, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachments The attachments

smtpHost The smtp host

Returns: true if the bulk email with the specified attachments is sent without issues, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the bulk mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachments The attachments

overrideProperties An array of properties

Returns: true if the bulk mail was successfully sent, false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

Returns: true if the email is sent successfully, false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

Returns: true if the email is sent, including to recipients in the “cc” field, or false in case of failure.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

Returns: true if the email is sent successfully, covering both “cc” and “bcc” recipients, or false if an error occurs.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachment A single attachment

Returns: true if the email containing the single specified attachment is sent successfully, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachment A single attachment

smtpHost The smtp host

Returns: true if the email containing the single specified attachment is sent successfully, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachment A single attachment

overrideProperties An array of properties

Returns: true if the email containing the single specified attachment is sent successfully, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachments The attachments

Returns: true if the email, along with the specified attachments, is sent successfully, or false otherwise.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachments The attachments

smtpHost The smtp host

Returns: true if the email is dispatched with the specified attachments and overridden properties, or false if sending fails.

to A string containing 1 or multiple addresses separated by a comma.

from A string containing an address and optional reply addresses, separated by commas.

subject The subject of the mail

msgText The message text

cc One or more addresses separated by a comma

bcc One or more addresses separated by a comma

attachments The attachments

overrideProperties An array of properties

Returns: true if the email is dispatched with the specified attachments and overridden properties, or false if sending fails.

MailMessage
Attachment
String
String
Array
Attachment
String
Array
String
Attachment
String
String
Attachment
String
String
String
Attachment
String
Object
MailMessage
Object
Array
String
Boolean
String
String
Boolean
Array
String
String
Boolean
Number
Array
String
String
Boolean
Number
Date
Array
String
String
Boolean
Number
Date
String
Array
String
String
Boolean
Number
Date
Array
Array
String
String
String
String
Boolean
String
String
String
String
String
Boolean
String
String
String
String
String
String
Boolean
String
String
String
String
String
String
Attachment
Boolean
String
String
String
String
String
String
Attachment
String
Boolean
String
String
String
String
String
String
Attachment
Array
Boolean
String
String
String
String
String
String
Array
Boolean
String
String
String
String
String
String
Array
String
Boolean
String
String
String
String
String
String
Array
Array
Boolean
String
String
String
String
Boolean
String
String
String
String
String
Boolean
String
String
String
String
String
String
Boolean
String
String
String
String
String
String
Attachment
Boolean
String
String
String
String
String
String
Attachment
String
Boolean
String
String
String
String
String
String
Attachment
Array
Boolean
String
String
String
String
String
String
Array
Boolean
String
String
String
String
String
String
Array
String
Boolean
String
String
String
String
String
String
Array
Array
Boolean
String
Attachment
Attachment
Attachment
Attachment
String
MailMessage
Array
Boolean
Array
Array
Array
Array
Array
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
from
createBinaryAttachment(filename, binarydata)
createBinaryAttachment(filename, binarydata, mimeType)
createTextAttachment(filename, textdata)
createTextAttachment(filename, textdata, mimeType)
getLastSendMailExceptionMsg()
getMailMessage(binaryblob/string)
getPlainMailAddresses(addressesString)
isValidEmailAddress(email)
receiveMail(username, password, leaveMsgsOnServer)
receiveMail(username, password, leaveMsgsOnServer, receiveMode)
receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate)
receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host)
receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties)
sendBulkMail(to, from, subject, msgText)
sendBulkMail(to, from, subject, msgText, cc)
sendBulkMail(to, from, subject, msgText, cc, bcc)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachment)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachments)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)
sendMail(to, from, subject, msgText)
sendMail(to, from, subject, msgText, cc)
sendMail(to, from, subject, msgText, cc, bcc)
sendMail(to, from, subject, msgText, cc, bcc, attachment)
sendMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
sendMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
sendMail(to, from, subject, msgText, cc, bcc, attachments)
sendMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
sendMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)