Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Form Help Required
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Form Help Required

 Post Reply Post Reply
Author
davide View Drop Down
Newbie
Newbie
Avatar

Joined: 03 February 2004
Location: United Kingdom
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote davide Quote  Post ReplyReply Direct Link To This Post Topic: Form Help Required
    Posted: 03 February 2004 at 6:03am

Hope you may help.

I have a form on my page and would like to attach files to the form and mail them to me. The script I have for the form is:

<form action="D2sendmail.asp" method="post" name="form1">
<input name="fmname" type="text" class="textboxes" id="fmname" size="45">
<input name="fmemail" type="text" class="textboxes" id="fmemail" size="45">
<textarea name="fmquestion" cols="39" rows="5" class="textboxes" id="fmquestion"></textarea>
<input type=file name="browse">
</form>

This displays correctly but when I send it it sends all the other information except my attached file. The processing page I have for the form is shown below:

Dim HTML
    HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
    HTML = HTML & "<html>"
    HTML = HTML & "<head>"
    HTML = HTML & "<meta http-equiv=""Content-Type"""
    HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
    HTML = HTML & "<meta name=""GENERATOR"""
    HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
    HTML = HTML & "<title>HTMLMail</title>"
    HTML = HTML & "</head>"
    HTML = HTML & "<body bgcolor=""edefea"">"
    HTML = HTML & "<font color=#000099 size=3 face=Arial, Helvetica, sans-serif>"
  HTML = HTML & "<p></p>"
  HTML = HTML & "<b>Message from:</b> " & request.Form ("fmname")
 HTML = HTML & "<p></p>"
 HTML = HTML & "<b>Users email:</b> " & request.Form("fmemail")
 HTML = HTML & "<p></p>"
 HTML = HTML & "<b>Message text:</b> " & request.Form("fmquestion")
 HTML = HTML & "<p></p>"
 HTML = HTML & "<b>File:</b> " & request.Form("file")
 HTML = HTML & "<p></p>"
 HTML = HTML & "<b>Date/Time:</b> " & now()
 HTML = HTML & "<p></p>"
 HTML = HTML & "<b>Users IP address:</b> " & request.ServerVariables("REMOTE_ADDR")
 HTML = HTML & "<p></p>"
 HTML = HTML & "<b>****** END OF MESSAGE ******</b></font> "
    HTML = HTML & "</body>"
    HTML = HTML & "</html>"

  Dim D2Mail
   Set D2Mail = CreateObject("CDONTS.NewMail")
    D2Mail.From= request.Form("fmEmail")
    D2Mail.To= mailaddr
    D2Mail.Subject="Mail from " & sitesname & " website contact form"
    D2Mail.BodyFormat=0
    D2Mail.MailFormat=0
    D2Mail.Body=HTML
    D2Mail.Send
 
 set HTML = nothing
    set D2Mail=nothing

I know it will probable be something I have forgotten to add in or something. Any help on this is greatly appreciated


Thanks

Back to Top
mobious View Drop Down
Newbie
Newbie


Joined: 02 February 2004
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mobious Quote  Post ReplyReply Direct Link To This Post Posted: 03 February 2004 at 1:12pm
Back to Top
Bullschmidt View Drop Down
Groupie
Groupie


Joined: 31 May 2003
Location: United States
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bullschmidt Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 6:53am

I don't see where you're telling the D2Mail object what the attached files are to be.

You may want to check this resource out:

http://www.asp101.com/samples/email_attach.asp

J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.