Results 1 to 9 of 9

Thread: put an attachement with the cdont object

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    put an attachement with the cdont object

    how can I attached a file to an email in asp!

    i.e.the file will be selected with the file type input:

    <input type="file">

    any ideas!!

  2. #2
    kayoca
    Guest
    If you have created the CDONTS object you can use .AttachFile for sending a file within your email.

  3. #3

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    so i can do something like:

    myMail.AttachFile = request("fileToAttachPath")

    just like that,



    btw thanx a lot!!!!!!

  4. #4

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    Code:
    Microsoft VBScript runtime error '800a01b6' 
    
    Object doesn't support this property or method: 'AttachFile' 
    
    /clients/baytek/corporate/sendTo.asp, line 21

    your code is not working, what i am doiing wrong!!

  5. #5

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    ok, i had an error, now the syntax is good but not working:

    that is the error:

    Code:
    C:\name.txt :file that i try to upload!
    
    error '80004005' 
    
    Unspecified error 
    
    /clients/baytek/corporate/sendTo.asp, line 16
    and my code:

    Code:
    Dim myMail 
    Set myMail = CreateObject("CDONTS.NewMail") 
    
    Call myMail.AttachFile(request("thefile"))
    myMail.From = request("FROM") 'This is the From line
    myMail.To = "[email protected]" 'Put here the recipient's email address 
    myMail.Subject = "Request for informations"
    
    myMail.BodyFormat = 0 
    myMail.MailFormat = 0 
    myMail.Body =  htmlContent
    
    myMail.Send 
    Set myMail = Nothing


    Can i put an attachement to an email, if the attachement come
    from the client side!!

  6. #6
    kayoca
    Guest
    Dont use Call by AttachFile.
    Code:
    myMail.AttachFile( Request("thefile") )

  7. #7

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    i think i haveto upload it to my server and then attach it to an
    email from my server.



    SO, how can i upload a file to my server!!

  8. #8
    kayoca
    Guest

  9. #9

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    tx a lot kayoca, i'll llok intyo it~!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width