cjkenworthy
Programmer
I am sending an email and attaching a file using straight forward CDO. The email sends ok, as I recieve it - but the attached file, despite having the correct name, is unreadable and is always the same size (78 bytes). (If opened in notepad the file is empty)
I have tried different filenames, locations etc... The file itself is readable and I can access it in windows explorer as a standard file. I have set the anonymous account to have read/write permissions on the directory where the file resides.
Why is it not attaching the actual file?
Cheers.
CODE:
(The Server MapPath gives: c:\inetpub\ - Which is correct
Dim MyCDONTSMail
Dim HTML
Set MyCDONTSMail = CreateObject("CDONTS.NewMail"
MyCDONTSMail.AttachFile(Server.MapPath("claim_data/" & Filename))
HTML = "<html> etc ..."
MyCDONTSMail.From="system@mydomain.com"
MyCDONTSMail.To="myaddress@mydomain.com"
MyCDONTSMail.Subject="Data File"
MyCDONTSMail.BodyFormat=0
MyCDONTSMail.MailFormat=0
MyCDONTSMail.Body=HTML
MyCDONTSMail.Send
set MyCDONTSMail=nothing
I have tried different filenames, locations etc... The file itself is readable and I can access it in windows explorer as a standard file. I have set the anonymous account to have read/write permissions on the directory where the file resides.
Why is it not attaching the actual file?
Cheers.
CODE:
(The Server MapPath gives: c:\inetpub\ - Which is correct
Dim MyCDONTSMail
Dim HTML
Set MyCDONTSMail = CreateObject("CDONTS.NewMail"
MyCDONTSMail.AttachFile(Server.MapPath("claim_data/" & Filename))
HTML = "<html> etc ..."
MyCDONTSMail.From="system@mydomain.com"
MyCDONTSMail.To="myaddress@mydomain.com"
MyCDONTSMail.Subject="Data File"
MyCDONTSMail.BodyFormat=0
MyCDONTSMail.MailFormat=0
MyCDONTSMail.Body=HTML
MyCDONTSMail.Send
set MyCDONTSMail=nothing