Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > asp CDONTS attachment not being sent correctly

Thread Tools

asp CDONTS attachment not being sent correctly

Ryan McLean
Posts: n/a
Hello everyone! I have a question for ya'll. In a web-based asp
application I am creating and (attempting to) attach a file. The
email sends correctly, but when I try to open the attachment, it is
blank. Now, I know you all are probably thinking that the file is
blank on the server or it doesn't exist at the address that I specify.
Well, I checked on the server and the file is there and there is
stuff in it. Could this be a permissions thing, or am I just writing
the syntax incorrectly?

Thanks in advance for any assistance.


p.s. Here is some code (notice the response.writes at the bottom of
each sub, they print the same stuff):

call subFileCreate("/gearupqa/reporttemp/",
"Academic_Information.html", strBody)
call subEmail(request.form("txtEmail"), "(E-Mail Removed)", "Here is the
report that you requested.", "/gearupqa/reporttemp/",
"Academic_Information.html", "GEAR UP Administration : Academic
Information Page")

sub subEmail(dest, orig, mail_body, path, file_name, subj)
Set objMail = CreateObject("CDONTS.Newmail")
objMail.From = orig & "<GearUp>"
objMail.To = dest & "<" & dest & ">"
objMail.Subject = subj
objMail.AttachFile server.mappath(path & file_name),
file_name objMail.Body = mail_body
objMail.BodyFormat=0 '0 HTML, 1 plain text
objMail.MailFormat=0 '0 MIME format, 1 plain text
Set objMail = nothing
response.write(server.mappath(path & file_name) & "<br>")
end sub

sub subFileCreate(path, file_name, text)
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set InStream = FileObject.OpenTextFile(server.mappath(path &
file_name), 8, TRUE, -2)
set InStream = nothing
set FileObject = nothing
response.write(server.mappath(path & file_name) & "<br>")
end sub

Here are the printed paths:
C:\webs\gearup\gearupqa\reporttemp\Academic_Inform ation.html
C:\webs\gearup\gearupqa\reporttemp\Academic_Inform ation.html

Thanks again!
Reply With Quote
Ryan McLean
Posts: n/a
Hi Curt! Thank you for the fast response and assistance. I tried
what you suggested regarding the email code being executed using
hard-coded values outside of the routine on an asp page; sadly it was
of no avail.

I didn't know there was a cdo email . . . I'll have to look for some
information on it.

Thank you again for your help.

Reply With Quote
Ryan McLean
Posts: n/a
Yay! The new CDO method worked perfectly! Thanks again!


p.s. Is there any way to change the file name as it appears in the
email? I haven't seen any parameters that allow you to do that like
you can in cdonts.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
No email sent? Server.CreateObject("CDONTS.NewMail") summer Javascript 1 10-26-2006 09:11 PM
Cdonts Attachment From Memory, not from file Serge ASP General 0 03-23-2005 03:12 PM
CDONTS attachment to external image Dave Karmens ASP General 1 02-25-2004 10:46 PM
Hotmail blocks emails sent w/ CDONTS/CDOSYS???? Todd M. Taylor ASP General 0 02-02-2004 05:20 PM
CDONTS - PDF Attachment / decoding problem Kyle Pula ASP General 2 07-28-2003 06:41 PM