|
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
|