Just like with incoming attachments Mailit gives you two main options when sending attachments. You
can either import files into FileMaker before sending them to keep them stored in the database or you
can send files from disk directly as attachments without storing them in FileMaker. For most cases it
is recommended that you store attachments related to messages in FileMaker for further reference.
This way you ensure that you keep a copy of the exact file you sent with a message.
Use the function Emai_ShowFileDialog to let users locate a file, which is to be used attachment.
To import the selected file into FileMaker the path returned is used as input for the function
Emai_ImportFile . In case you do not want to store attachments in FileMaker save the selected
path to a field at this point. No matter if you decide to import outgoing attachments into FileMaker or not
you can use the functions Emai_GetFileName , Emai_GetFileIcon and Emai_GetFileSize
to import the attachment name, icon and file size into FileMaker fields.
To set an attachment for a message the function Emai_SmtpAddAttachment is invoked. If the
attachment has not been stored in FileMaker embed the function Emai_ImportFile into this function
call and use the attachment path that has been obtained earlier using Emai_ShowFileDialog.
This lets Mailit import a file directly when setting it as attachment without storing it in FileMaker.
The following example adds an external file to the next message as attachment without importing
it into FileMaker. This example assumes that the path of the file is stored in a text field.
Emai_SmtpAddAttachment(Emai_ImportFile(Globals::AttachmentPath);
Dacons Mailit 6 -- FileMaker Plug-In Manual 78
"attachment"; Emai_GetFileName(Globals::AttachmentPath);
"once";"" )
Before adding attachments to an outgoing message using Emai_SmtpAddAttachment the function
Emai_SmtpResetMessage is invoked, when using a non-threaded mode. It resets all internal message
variables (from last message) and has options that enable you to reuse encoded attachments
from the previous message. This way, attachments that are sent with multiple messages have to be
encoded only once which saves time when sending many messages. When sending mass mailings
it is even possible to combine global attachments (same for all recipients; encoded only once) and
individual attachments (different for every message).
Just like incoming attachments you can export and open outgoing attachments that have been imported
into FileMaker by using the function Emai_ExportFile and Emai_OpenFile