Skip to main content

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?
I sent the object simply to see if you're system gets the same reaction, here is the source.

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?
I sent the object simply to see if you're system gets the same reaction, here is the source.

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?
Of course my CDO is different from yours, so I am not able to test this.
But I found an example on MSDN that illustrates how to add an attachment, here is what they do:

In working storage add:

  77 CountOfFiles PIC 9(3).


In procedure division, substitute your attachment with the following:

INQUIRE MyMessage AttachmentCount IN CountOfFIles.
MODIFY MyMessage AttachmentIndex = CountOfFiles.
MODIFY MyMessage
AttachmentPathName = "c:\\bks\\msemail.cbl"
AttachmentName = "c:\\bks\\msemail.cbl"
AttachmentType = mapData | should be defined in def file, but is numeric value 0
AttachmentPosition = 1.


Here is the url if you would like to read this yourself:
http://support.microsoft.com/default.aspx?scid=kb;en-us;138534

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?
One thing that came to my mind is... Since CDO is ment to run in the security context of a web server, it might be that it will not allow to access files in directories that are not granted for the webserver to see...

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?
One thing that came to my mind is... Since CDO is ment to run in the security context of a web server, it might be that it will not allow to access files in directories that are not granted for the webserver to see...

[Migrated content. Thread originally posted on 28 May 2003]

Thanks to Gisle Forseth for that excellent sample program using MS CDO to send email! Doesn't get any easier than that. I would like to send an attachment with this email method, but I am having trouble. I tried putting this code in right after the MODIFY NEW-MAIL statement:

MODIFY NEW-MAIL @AttachFile
("c:\\requests.pdf",
"requests.pdf").

I am now getting the following error message when I run my program:

"Class is not licensed for use"

Has anyone tried sending attachments using Gisle's code?
One thing that came to my mind is... Since CDO is ment to run in the security context of a web server, it might be that it will not allow to access files in directories that are not granted for the webserver to see...