help with CDOSYS attachments?
Posted on 2007-11-26
HI, I've been reading about the change from CDONTS in w2003 to CDOSYS.
This causes me a problem as a useful parameter of CDONTS.NewMail.attachFile() doesnt seem to exist in CDOSYS.Message.addAttachment()
Situation is that my server is sending emails out really fast and some files sent out in successive emails are common in terms of content and name. The temporary get deleted once sent but Windows doesnt always delete them instantly and I've hit timing problems where names are common.
I needed to either
1) call the files by a GUID identity and pass that into the mail send as an attachment , but also pass its meaningful name into the email (ie attachFile ("\temp\F345626262A.xml", "invoice27.xml") so the recipient sees the meaningful name "invoice27.xml" in the email where the attachment is shown)
2) Use a temporary folder called by a guid and store the file by its meaningful name in there, send, then delete the file and folder This works okay for Message.addAttachment() as the meaningful name is used, but I cant seem to delete the folder using ASP after the email send as the mail code isnt letting it go (error: "folder could not be removed"). If you comment out the single line of addAttachment() code , the folder is deleted without any issue.
Obviously I cant just let these folders build up.
I have checked the parent folder's permissions and IWAM_(machine) and IUSR_(machine) have full permissions. CREATOR_OWNER has sufficient permissions. These are all passed on down to child folders. I don't think there is a huge permissions problem anyway as the folders can be deleted if no attachment is actually sent.
Can anyone tell me how to get addAttachment() to accept a given file, but call it by another (ie meaningful) name within the actual email? (ie as attachFile() did)