asp CDONTS attachment not being sent correctly

Discussion in 'ASP General' started by Ryan McLean, Jul 16, 2003.

  1. Ryan McLean

    Ryan McLean Guest

    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.

    Ryan

    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"), "", "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
    objMail.Send()
    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)
    InStream.WriteLine(text)
    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_Information.html
    C:\webs\gearup\gearupqa\reporttemp\Academic_Information.html

    Thanks again!
    Ryan McLean, Jul 16, 2003
    #1
    1. Advertising

  2. Ryan McLean

    Ryan McLean Guest

    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.

    Ryan
    Ryan McLean, Jul 17, 2003
    #2
    1. Advertising

  3. Ryan McLean

    Ryan McLean Guest

    Yay! The new CDO method worked perfectly! Thanks again!

    Ryan

    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.
    Ryan McLean, Jul 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ajay

    Attachment not sent of MIME format

    Ajay, Jul 24, 2003, in forum: ASP General
    Replies:
    0
    Views:
    91
  2. Kyle Pula

    CDONTS - PDF Attachment / decoding problem

    Kyle Pula, Jul 25, 2003, in forum: ASP General
    Replies:
    2
    Views:
    125
    Kyle Pula
    Jul 28, 2003
  3. Todd M. Taylor

    Hotmail blocks emails sent w/ CDONTS/CDOSYS????

    Todd M. Taylor, Feb 2, 2004, in forum: ASP General
    Replies:
    0
    Views:
    212
    Todd M. Taylor
    Feb 2, 2004
  4. Serge
    Replies:
    0
    Views:
    106
    Serge
    Mar 23, 2005
  5. summer
    Replies:
    1
    Views:
    139
Loading...

Share This Page