[archive] Attaching docs to email using SMTP

[Migrated content. Thread originally posted on 23 July 2008]

I have looked at the forums and have tried their suggestions by I cannot send an email with an attachment, from my program.

Here is the code I have

In Working Storage

01 EMAIL-HANDLE USAGE HANDLE OF SMTP. (The DEF file for the SMTP object is compiled into my program)
01 ATTACH-HANDLE USAGE HANDLE OF Attachment.


Then in the code I am modifying the EMAIL-HANDLE with the normal email info, address, subject, message, importance, etc. Then before the code

MODIFY EMAIL-HANDLE
@RaiseError(0),
@SendEmail().

I have

INQUIRE EMAIL-HANDLE @Attachments IN ATTACH-HANDLE.
MODIFY ATTACH-HANDLE
@AttachmentName = ATTACH-NAME (which is the path and file name of the document that I want to attach to the email)

The email sends, but there is no attachment. I have tried different properties, methods and events, but I cannot seem to get the file to attach to the email. (I have tried using @FilePath, @Attachments. There is no @Add in the Def file, so I can use that)

Any help would be appreciated.