SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sending Attachment + CDONTS

    Hi all,

    I want to create a script that allows the user to send an attachment via a web page form.

    My problem is getting the attachment to work. What code should I use.

    Here is what I have so far:

    Code:
       Dim MyBody 
       Dim MyCDONTSMail
       
       dim submitted, name, email, country, comments, address1, address2, phone, attachment
     
     'Variables already set
       		
       Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
       	MyCDONTSMail.From= email
       	MyCDONTSMail.To= "kevin@cc.ie"
       	MyCDONTSMail.Subject="Information Request"
      
      	MyCDONTSMail.AttachFile(attachment, 1)
      
       	MyBody = "Name: " & name & vbCrLf
       	MyBody = MyBody & "Email: " & email & VbCrLf
       	MyBody = MyBody & "Address: " & address1 & VbCrLf
       	MyBody = MyBody & "Address2: " & address2 & VbCrLf
       	MyBody = MyBody & "County: " & county & VbCrLf
       	MyBody = MyBody & "Phone: " & phone & VbCrLf
       	MyBody = MyBody & "Comments: " & VbCrLf & comments & VbCrLf
       	MyCDONTSMail.Body= MyBody
       	set MyCDONTSMail=nothing

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'll have to upload the attachment to server first, then attach it to the email.


  3. #3
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But how come it works fine using Firefox browser??

  4. #4
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The browser your using shouldn't make any difference... is it not working with IE? Is there an error?


Bookmarks

Posting Permissions

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