Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

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