简体   繁体   中英

How do you send an attachment with cdo.message if the file is in use

I am trying to send an email in classic asp site with an attachment. I am recieving the error "The process cannot access the file because it is being used by another process. "

The file is sitting in a shared folder on the same physical server that is hosting the site. If I check in computer management on the server I can confirm that a user has it open.

My question then is: Am I able to send a copy of the file that is saved to disk using cdo.message if that file is in use? I stripped away the rest of my code to do a test and I was still getting the same error using this.

'Create the Message Object
Set objMsg = Server.CreateObject("CDO.Message")
'Set the properties of the Message
With objMsg 
    Set .Configuration = cdoConfig 
        .From = sFrom
        .To = sTo
        .Subject = sSubject
        .TextBody = sBody 
        .Send 
    End With

不,您不能绕过此限制,也不会想要发送损坏的文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM