Skip to main content

Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

I got these responses on a google query ... stackoverflow.com/.../unlock-file-after-sending-as-attachement-with-cdo ... and  ...weblog.west-wind.com/.../SmtpClient-and-Locked-File-Attachments .. this second one recommends calling the Dispose function to unlock the file. I hope one of these helps.


Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

"Is there any other way for creating and sending e-mail messages (except using an outlook object) ?"

Here is another way to use CDO as a VBScript (which you call with CALL SYSTEM):

community.microfocus.com/.../11213.aspx


Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

If you don't mind calling a Python script, it's relatively easy to send an email with an attachment without using the Outlook object.


Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

Thank you all for your answers...

@shjerpe

I am aware of these articles but I can't find a dispose() definition in the CDO def file... I suppose DESTROY should do the same job as dispose()...

@Tom Morison and  kenthudson

Ok, I will give them a look


Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

we use blat for sending emails with Cobol.

http://www.blat.net/


Hi all,

I am using the CDO library in order to create and send a mail with an attachment. After mail is sent, program deletes or moves the attachment file to another folder. My program works well (message is sent) except the following:

wrun32.exe keeps the attachment file locked and the program can't delete it or move it to another folder.

Although I am doing all the necessary DESTROY statements, the attachment file is actualy deleted or moved only when wrun32.exe terminates.

Is there any other way for creating and sending e-mail messages (except using an outlook object) ?

Thanks

 

Great! Simple and easy, it worked like a charm. Thank you neidingd