The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: ASP file email

  1. #1

    ASP file email

    hey.
    I'm putting a form with a browse button on a page, so that clients can send me some pics of their own, directly to my email... heres my code for my form...
    Code:
     <form method="post" action="photosupload.asp" name="submit" enctype="multipart/form-data">
    			  <font size="2">Enter your description : </font>
    			  <input name="textfield" type="text" size="70">
    			  <br><br>
    			  <font size="2">Choose your photo:</font> 
    			  <input type="file" name="filefield"><br><br>
    			  <input name="submit" type="submit" id="submit" value="Submit">
    			  <br>
    </form>
    Now, I'm struggeling with the asp part.... I've only done normal submit forms. .. how do I code THAT so that the file gets send to my email?

    thank you in advance...

  2. #2
    you need to download a component on to your server (or talk to your hosts) that will enable you to send files from a users machine to the servers

    In this example I've used the CDONTS component

    Code:
    	set smtp = Server.CreateObject("CDONTS.NewMail")
    	smtp.To="whoever@tomail.com"
    	smtp.From="fromwhoever@frommail.com"
    	smtp.Subject="Page request"
    	smtp.BodyFormat=0
    	smtp.MailFormat=0
    	smtp.Body = lmailstring
    	smtp.AttachFile("[insert file path here")
    	smtp.Send
    
    ' lmailstring can be a HTML message/page or
    a simple "please find file attached"
    good tutorial on the CDONTS feature, http://www.webwizguide.info/asp/tuto...s_tutorial.asp

    if you're hosts don't use the CDONTS component they'll use another one that will be similar (there are a few components that do this and they all work the same. I've just used CDONTS because it's the most common)

    hope this helps
    now with blog, click here

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012