Product Logo

SMTPit Pro

A Feature-rich Email plug-in




The SMTPit_SetAttachment function allows you to attach a file from your hard drive or network to the current email being sent. You must specify the full path and filename of the file. You can set more than one file path with this function by separating the file names with the paragraph mark or, if in a field, with a return. You can also simply reference a container field to attach the file in the container field. Only one container field can be attached in a single function call. You must call the function multiple times to attach multiple container fields.

Return TypeText
FormatSMTPit_SetAttachment ( Attachment(s) ; SMTPit_Append )
Required Parameters

Specify the Path(s) and File Name(s) of the Attachment(s) on the Hard Drive (separate multiple Attachments with a Paragraph Mark or Return); or specify a Container Field that holds the Attachment.

Optional Parameters

Leave this in to add the(se) Attachment(s) to the current list of Attachments.

Example 1

Attaches the file "resume.doc" on windows.

SMTPit_SetAttachment( "c:\My Documents\resume.doc")
Example 2

Attaches the file "resume.doc" on Mac.

SMTPit_SetAttachment( "/Documents/resume.doc")
Example 3

Attaches the "Manual.pdf" and "How to Install.pdf" files on Windows.

SMTPit_SetAttachment( "c:\pdfs\Manual.pdf¶c:\pdfs\How to Install.pdf" )
Example 4

Attaches the file in the MyEmailAttachmentsField. (The field can either contain a path, or be a container field with a file in it.)

SMTPit_SetAttachment( MyEmailAttachmentsField)
Example 5

Attaches the files in the Container1 and the Container2 fields. When calling this function multiple times, the second (and further) function calls must include the 2nd parameter of SMTPit_Append, otherwise the second function call would overwrite the data set by the first call.

SMTPit_SetAttachment( Container1 ) & "¶" & SMTPit_SetAttachment( Container2 ; SMTPit_Append )