How do I use CDONTS.new to send an email with attachment?

Discussion in 'ASP General' started by Jammer, Oct 17, 2004.

  1. Jammer

    Jammer Guest

    Can someone give me some sample code to use CDONTS.new to send email
    with an attachment?

    I've got sample code from the following website;

    http://msdn.microsoft.com/library/e...newmail_object_cdonts_library_.asp?frame=true

    But, I'm having trouble GETTING the relevant field from my HTML form!
    I can't seem to be able to get the field property. :(
    It just comes up as a blank.

    Any help would be appreciated.

    Thanks.


    Jam
     
    Jammer, Oct 17, 2004
    #1
    1. Advertising

  2. Is the problem with how to attach a file to a CDONTS message or how to
    accept a file from that a user uploaded first? Is that the source of the
    file? If so, you must first save the file to the file system on your server
    and then use the .AttachFile method of the CDONTS.NewMail object.

    For further help, please provide more details, like code, error messages,
    etc.

    Ray at home

    "Jammer" <> wrote in message
    news:...
    > Can someone give me some sample code to use CDONTS.new to send email
    > with an attachment?
    >
    > I've got sample code from the following website;
    >
    > http://msdn.microsoft.com/library/e...newmail_object_cdonts_library_.asp?frame=true
    >
    > But, I'm having trouble GETTING the relevant field from my HTML form!
    > I can't seem to be able to get the field property. :(
    > It just comes up as a blank.
    >
    > Any help would be appreciated.
    >
    > Thanks.
    >
    >
    > Jam
     
    Ray Costanzo [MVP], Oct 17, 2004
    #2
    1. Advertising

  3. Jammer

    Jeff Cochran Guest

    On 17 Oct 2004 09:25:18 -0700, (Jammer) wrote:

    >Can someone give me some sample code to use CDONTS.new to send email
    >with an attachment?
    >
    >I've got sample code from the following website;
    >
    >http://msdn.microsoft.com/library/e...newmail_object_cdonts_library_.asp?frame=true
    >
    >But, I'm having trouble GETTING the relevant field from my HTML form!
    >I can't seem to be able to get the field property. :(
    >It just comes up as a blank.


    This could be a problem with the form, your method of retrieving it or
    the code you use.

    First, stop using CDONTS and use CDO instead. See:

    http://www.aspfaq.com/show.asp?id=2026

    Second, are you able to send mail but not with an attachment, or not
    send mail at all? Have you tried just sending messages with
    attachments without pulling information from a form? You said the
    field property comes up as a blank, have you tried a Response.Write to
    see what is actually being processed by the form?

    Post relevant code snippets for real help.

    Jeff
     
    Jeff Cochran, Oct 17, 2004
    #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. Sam
    Replies:
    1
    Views:
    424
  2. yihan
    Replies:
    3
    Views:
    508
    Thomas Weidenfeller
    Nov 10, 2004
  3. zhao wang

    How to send the email attachment

    zhao wang, Jan 3, 2005, in forum: Java
    Replies:
    2
    Views:
    438
    Ajith KR via JavaKB.com
    Jan 4, 2005
  4. Todd Price
    Replies:
    0
    Views:
    136
    Todd Price
    Mar 16, 2005
  5. yuvalbra
    Replies:
    0
    Views:
    94
    yuvalbra
    Feb 25, 2007
Loading...

Share This Page