AddMailAttachmentData()
Syntax
Result = AddMailAttachmentData(#Mail, Description$, *Buffer, BufferLength [, MimeType$])Description
Add memory data as an attachement to the #Mail. 'Description$' will be the information string displayed in the mail. '*Buffer' and 'BufferLength' specify the memory area and its size when added to the mail as an attachment. Once the attachment has been added, the memory area may be changed or freed, since its entire contents are copied into the mail. If the attachment can not be created, 'Result' will be 0.
More information about the optional 'MimeType$' parameter may be found at AddMailAttachment().
Note: any number of attachments may be added to the mail, but the size limit available for a single attachment is currently set at 100MB. Most servers and clients do not have the capacity to handle attachments of that size, therefore it is advised that each attachment be kept to a reasonable sizeExample:
InitNetwork() If CreateMail(0, "test@purebasic.com", "Hello") If AddMailAttachmentData(0, "Attachment 1", ?Hello, 5) Debug "Attachment correctly added" Else Debug "Attachment failed" EndIf EndIf DataSection Hello: Data.b 'H', 'e', 'l', 'l', 'o'
Supported OS
All