Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

MailComposer.AddAttachmentContainer

Adds an attachment to the email based on a container field.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
MailComposer 7.3 No No No No Yes

MBS( "MailComposer.AddAttachmentContainer"; Container; Name { ; MimeType } )

Parameters

Parameter Description Example value
Container The container to attach to email. Attachment::Container
Name The name for the attachment. "sample.pdf"
MimeType Optional
The mime type to use. e.g. "application/pdf" for PDF files. If missing, we use "application/octet-stream".
"application/octet-stream"

Result

Returns OK or error.

Description

Adds an attachment to the email based on a container field.
You can use Text.FileExtensionToMimeType to find the mime type for a file extension.
You can use AddAttachment several times to add several attachments.

Examples

Adds an attachment:

Set Variable [ $FieldName ; Value: Get(ScriptParameter) ]
Set Variable [ $Container ; Value: GetField ( $FieldName) ]
If [ IsEmpty ( $container ) = 0 ]
    Set Variable [ $path ; Value: GetAsText ( $Container ) ]
    Set Variable [ $name ; Value: MBS( "Path.LastPathComponent"; $path) ]
    Set Variable [ $extension ; Value: MBS( "Files.FileExtension"; $name ) ]
    Set Variable [ $mimeType ; Value: MBS( "Text.FileExtensionToMimeType"; $extension ) ]
    #
    Set Variable [ $r ; Value: MBS( "MailComposer.AddAttachmentContainer"; $container; $name; $mimeType) ]
End If

See also

Example Databases


Log   -   MailComposer.AddAttachmentFile

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins