HangTenDesign
asked on
CDONTS - "Unspecified error" when trying to attach File
I am getting an unspecified error ....
-------------------------- ---------- ------
error '80004005'
Unspecified error
/mortgagebanking/admin/rat es_savepdf .asp, line 48
-------------------------- ---------- ------
...while trying to attach a file. The email was sent fine without the Attachment. Here is my code below. I removed private information for this example.
-------------------------- ---------- ------
Set objMail = Server.CreateObject("CDONT S.NewMail" )
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = "xxxxx@xxxxx.com"
objMail.From = "xxxxx@xxxxx.com"
objMail.AttachFile "D:\xxxxx.pdf", "xxxxx.pdf"
objMail.Subject= "xxxxx"
objMail.Body = strbody
objMail.Send
-------------------------- ---------- ------
Thanks for your help!
--------------------------
error '80004005'
Unspecified error
/mortgagebanking/admin/rat
--------------------------
...while trying to attach a file. The email was sent fine without the Attachment. Here is my code below. I removed private information for this example.
--------------------------
Set objMail = Server.CreateObject("CDONT
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = "xxxxx@xxxxx.com"
objMail.From = "xxxxx@xxxxx.com"
objMail.AttachFile "D:\xxxxx.pdf", "xxxxx.pdf"
objMail.Subject= "xxxxx"
objMail.Body = strbody
objMail.Send
--------------------------
Thanks for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
could you try to attach a text file first?
objMail.AttachFile "c:\aaa.txt"
objMail.AttachFile "c:\aaa.txt"
>>Just to be sure, the AttachFile parameter is relative to the vbscript on the server right? Not relative to the user's local machine.
Yes, it should be. I understand c:\ access being out of the question from a security perspective... could you try it, though, just as a test to see if this is the problem? I would not recommend going against security standards, but perhaps it might point you to what the problem is...
Regards,
Phil
Yes, it should be. I understand c:\ access being out of the question from a security perspective... could you try it, though, just as a test to see if this is the problem? I would not recommend going against security standards, but perhaps it might point you to what the problem is...
Regards,
Phil
then
objMail.AttachFile "D:\aaa.txt"
also make sure the aaa.txt contains some data
>> the AttachFile parameter is relative to the vbscript on the server right? Not relative to the user's local machine
yes, it is running at server side
objMail.AttachFile "D:\aaa.txt"
also make sure the aaa.txt contains some data
>> the AttachFile parameter is relative to the vbscript on the server right? Not relative to the user's local machine
yes, it is running at server side
Also, what authentication do you use to execute this script? If you use anonymous authentication, you will need to make sure that your IIS anonymous user has access to the mapped share: D:\[whatever]\file_name.pd f directory structure.
Have you looked into this?
Thanks,
Phil
Have you looked into this?
Thanks,
Phil
I see the problem
>> objMail.AttachFile "D:\xxxxx.pdf", "xxxxx.pdf"
you need a full path to the file, obviously "xxxxx.pdf" is not
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/d3c6df90-b2d2-488d-aeed-de0396f0d7d1.asp
could you try objMail.AttachFile "D:\xxxxx.pdf"
see if it works?
>> objMail.AttachFile "D:\xxxxx.pdf", "xxxxx.pdf"
you need a full path to the file, obviously "xxxxx.pdf" is not
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/d3c6df90-b2d2-488d-aeed-de0396f0d7d1.asp
could you try objMail.AttachFile "D:\xxxxx.pdf"
see if it works?
sorry, never mind above
>>you need a full path to the file, obviously "xxxxx.pdf" is not
I believe the "xxxxx.pdf" (notice that it is the second argument) is just the file name to be used for the attachment (you can alias files if you want to), so this should not actually be the problem.
From your article:
Source (first argument)
Required. IStream object or String. The full path and file name of the file to be attached to the message, or a pointer to an IStream object containing the file data.
FileName (second argument)
Optional. String. The file name to appear in the attachment's placeholder in the message. If FileName is not supplied, the file name from the Source parameter is used.
Regards,
Phil
I believe the "xxxxx.pdf" (notice that it is the second argument) is just the file name to be used for the attachment (you can alias files if you want to), so this should not actually be the problem.
From your article:
Source (first argument)
Required. IStream object or String. The full path and file name of the file to be attached to the message, or a pointer to an IStream object containing the file data.
FileName (second argument)
Optional. String. The file name to appear in the attachment's placeholder in the message. If FileName is not supplied, the file name from the Source parameter is used.
Regards,
Phil
ASKER
I removed the D:\ in the parameter and removed the filename (second) and used a domain address. This worked.
Great -- thanks for sharing the solution!
Glad I was able to help..
Regards,
Phil
Glad I was able to help..
Regards,
Phil
ASKER
Just to be sure, the AttachFile parameter is relative to the vbscript on the server right? Not relative to the user's local machine.