This is a discussion on "ASP Email" within the Classic ASP section. This forum, and the thread "ASP Email are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
ASP Email
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
ASP Email
<%
Response.Buffer = true Function BuildUpload(RequestBin) PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") Pos = InstrB(BoundaryPos,RequestBin,getByteString("Conte nt-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filen ame=")) PosBound = InstrB(PosEnd,RequestBin,boundary) If PosFile<>0 AND (PosFile<PosBound) Then PosBeg = PosFile + 10 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) UploadControl.Add "FileName", FileName Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:")) PosBeg = Pos+14 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) UploadControl.Add "ContentType",ContentType PosBeg = PosEnd+4 PosEnd = InstrB(PosBeg,RequestBin,boundary)-2 Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg) Else Pos = InstrB(Pos,RequestBin,getByteString(chr(13))) PosBeg = Pos+4 PosEnd = InstrB(PosBeg,RequestBin,boundary)-2 Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) End If UploadControl.Add "Value" , Value UploadRequest.Add name, UploadControl BoundaryPos=InstrB(BoundaryPos+LenB(boundary),Requ estBin,boundary) Loop End Function Function getByteString(StringStr) For i = 1 to Len(StringStr) char = Mid(StringStr,i,1) getByteString = getByteString & chrB(AscB(char)) Next End Function Function getString(StringBin) getString ="" For intCount = 1 to LenB(StringBin) getString = getString & chr(AscB(MidB(StringBin,intCount,1))) Next End Function If request("Action")="1" then Response.Clear byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUpload(RequestBin) 'Create the file, change the path to the path U use for temp storage of the file 'make sure you have the IUSR_YOURCOMPUTER granted WRITE access to the uploads dir If UploadRequest.Item("blob").Item("Value") <> "" Then contentType = UploadRequest.Item("blob").Item("ContentType") filepathname = UploadRequest.Item("blob").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) FolderName = UploadRequest.Item("where").Item("Value") Path = Mid(Request.ServerVariables("PATH_TRANSLATED"), 1, Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(Request.ServerVariables("PATH_INFO"))) ToFolder = Path & "\" & FolderName value = UploadRequest.Item("blob").Item("Value") filename = ToFolder & "\" & filename Set MyFileObject = Server.CreateObject("Scripting.FileSystemObject") Set objFile = MyFileObject.CreateTextFile(filename) For i = 1 to LenB(value) objFile.Write chr(AscB(MidB(value,i,1))) Next objFile.Close Set objFile = Nothing Set MyFileObject = Nothing End If Title = UploadRequest.Item("Title").Item("Value") FirstName = UploadRequest.Item("First_Name").Item("Value") LastName = UploadRequest.Item("Last_Name").Item("Value") Building_No_Name = UploadRequest.Item("Building_No_Name").Item("Value ") Street = UploadRequest.Item("Street").Item("Value") Town = UploadRequest.Item("Town").Item("Value") County = UploadRequest.Item("County").Item("Value") Postcode = UploadRequest.Item("Postcode").Item("Value") Telephone_Number = UploadRequest.Item("Telephone_Number").Item("Value ") Mobile_Number = UploadRequest.Item("Mobile_Number").Item("Value") Work_Number = UploadRequest.Item("Work_Number").Item("Value") Email_Address = UploadRequest.Item("Email_Address").Item("Value") Sector = UploadRequest.Item("Sector").Item("Value") Set UploadRequest = Nothing body="<html><body><p align='center'><font size='5' face='Times New Roman' color='#0000FF'>Resume Details </font></p>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Post Applied for </td><td><font size='3' face='Times New Roman' color='#660033'>" & jobcode & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Name </td><td><font size='3' face='Times New Roman' color='#660033'>" & MyName & "</td></tr>" body=body & "<tr><td><font size='3' face='Times New Roman' color='#660033'>Current Position </td><td><font size='3' face='Times New Roman' color='#660033'>" & MyPosition & "</td></tr>" body=body & "<tr><td><font size='3' face='Times New Roman' color='#660033'>Other Info </td><td><font size='3' face='Verdana' color='#0000FF'>" & MyText & "</td></tr>" body = body & "</table></body></html>" Set objCDOMail = Server.CreateObject("CDONTS.NewMail") ObjCDOMail.From = MyEmailid ObjCDOMail.To = "steve.owens@rslsteeper.com" ObjCDOMail.BodyFormat = 0 ObjCDOmail.Mailformat = 0 ObjCDOMail.Subject = "Candidate Registration Form" & MyPosition ObjCDOMail.Body = body If Len(filename) > 5 then ObjCDOMail.AttachFile filename,nikfile end if ObjCDOMail.Send Set ObjCDOMail = Nothing ' Now the file in the uploads dir can be deleted Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFile filename set fso = nothing End If %> <html> <script language='javascript'> alert("Thank You for Registering Yor Resume"); location.replace("cvupload2.htm"); </script> </html> can you check that what i have done will work because it does not seem to for some reason |
|
|
|
|||
|
server.CreateObject("CDNOTS.NewMail")
should be: server.CreateObject("CDONTS.NewMail") |
|
|||
|
Maybe I am being anal; however, line 1:
<%@ Language=VBScript %> The CDONTS typo has already been addressed. |
|
||||
|
I'm not sure of your meaning here Savannah...
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
ok...
for this you need two files... Obviously the form itself... I can only guess what fields you want on the form, so here is one I borrowed from the web (cvupload.htm):-
Call this one cvupload.asp
You will of course have to modify it to fit in with your own form, but this will give you the general idea!!!
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
DJ....
You appear to have edited your initial post.... now the replys dont really make that much sense.... Could you in future just reply to the topic, then we can all follow the thread logically. I'll look over the code now.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
||||
|
The problem you are having is that you have not edited the email sending process...
MyEmailid needs to be changed to the variable that is assigned the email address field of the candidate. Also, you will need to change where the body is built up to incorporate your own fields... rather than the example I sent you. Hope this helps.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Right i have just about had enough of ASP now.
Here are my form and the asp script they are running at http://www.zrconsultants.co.uk/candi...istration.html <------Form-----> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Register Your CV</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language=JavaScript src="Scripts/scroll.js" type=text/javascript></script> </head> <body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF"> <div align="left"> <script language=JavaScript src="Scripts/ZR_Menu.js" type=text/javascript></script> <script language=JavaScript src="Scripts/mmenu.js" type=text/javascript></script> </div> <table width="780" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="110" colspan="3" align="center" valign="middle">[img]images/Banner.jpg[/img]</td> </tr> <tr> <td width="9" rowspan="5" valign="top" bgcolor="#000033"></td> <td width="762" height="37" valign="top"><font color="#000066" size="2" face="Verdana">Candidate Registration Form:</font> <hr></td> <td width="9" rowspan="5" valign="top" bgcolor="#000033"></td> </tr> <tr> <td height="14"></td> </tr> <tr> <td height="43" align="center" valign="top"> <font color="#000066" size="2"><font size="1" face="Verdana">To register with ZR Consultants Ltd and receive regular job updates please complete the below registration form.</font></font></p> <font size="1" face="Verdana"><font color="#000066">We will then store your details and inform you of new vacancies as soon as they become available.</font></font></p></td> </tr> <tr> <td height="32"></td> </tr> <tr> <td height="464" align="center" valign="middle"> <form METHOD="POST" ENCTYPE="multipart/form-data" action="cvupload.asp" name="mailform" id="mailform"> <input TYPE="HIDDEN" NAME="where" value="Fileupload"> <table> <tr> <td width="158" ALIGN="right"><font color="#000066" size="1" face="Arial">Title</font></td> <td width="242"><font face="Arial"> <select name="Title" id="Title"> <option value="Mr">Mr</option> <option value="Mrs">Mrs</option> <option value="Miss">Miss</option> <option value="Ms">Ms</option> <option value="Doctor">Doctor</option> <option value="Sir">Sir</option> </select> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">First Name</font></td> <td><font face="Arial"> <input NAME="First_Name" TYPE="TEXT" id="First_Name" SIZE="25"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Last Name</font></td> <td><font face="Arial"> <input NAME="Last_Name" TYPE="TEXT" id="Last_Name" SIZE="25"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Building Name/No.</font></td> <td><font face="Arial" color="#C0C0C0"> <input NAME="Building_No_Name" TYPE="TEXT" id="Building_No_Name" SIZE="35"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Street</font></td> <td><font face="Arial"> <input NAME="Street" TYPE="TEXT" id="Street" SIZE="35"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Town</font></td> <td><font face="Arial"> <input NAME="Town" TYPE="TEXT" id="Town" SIZE="35"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">County</font></td> <td><font face="Arial"> <input NAME="County" TYPE="TEXT" id="County" SIZE="35"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Postcode</font></td> <td><font face="Arial"> <input NAME="Postcode" TYPE="TEXT" id="Postcode" SIZE="12" MAXLENGTH="12"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Telephone Number</font></td> <td><font face="Arial"> <input NAME="Telephone_Number" TYPE="TEXT" id="Telephone_Number" SIZE="25"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Mobile number</font></td> <td><font face="Arial"> <input NAME="Mobile_Number" TYPE="TEXT" id="Mobile_Number" SIZE="25" MAXLENGTH="25"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Work number ( Discretion Assured)</font></td> <td><font face="Arial"> <input NAME="Work_Number" TYPE="TEXT" id="Work_Number" SIZE="25" MAXLENGTH="25"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">E-mail Address</font></td> <td><font face="Arial"> <input NAME="Email_Address" TYPE="TEXT" id="Email_Address" SIZE="40"> </font></td> </tr> <tr> <td ALIGN="right"><font color="#000066" size="1" face="Arial">Please Attach Your CV here</font></td> <td valign="middle" nowrap><font face="Arial"> <input name="CV" type="file" id="CV"> </font></td> </tr> <tr> <td height="26" ALIGN="right" valign="top"><font color="#000066" size="1" face="Arial">Sector</font></td> <td valign="top"><font face="Arial"> <select name="Sector" id="Sector"> <option value="Accountancy">Accountancy</option> <option value="Admin/Secretarila">Admin/Secretarila</option> <option value="Banking">Banking</option> <option value="Catering/Hospitality">Catering/Hospitality</option> <option value="Creative/Media">Creative/Media</option> <option value="Customer Services">Customer Services</option> <option value="Education">Education</option> <option value="Enigineering">Enigineering</option> <option value="Financial Services">Financial Services</option> <option value="General Insurance">General Insurance</option> <option value="Health/Medical">Health/Medical</option> <option value="HR/Training">HR/Training</option> <option value="IT">IT</option> <option value="Legal">Legal</option> <option value="Leisure/Tourism">Leisure/Tourism</option> <option value="Manufacturing/Production">Manufacturing/Production</option> <option value="Marketing/Advertising">Marketing/Advertising</option> <option value="Purchasing">Purchasing</option> <option value="Recruitment Consultant">Recruitment Consultant</option> <option value="Retail">Retail</option> <option value="Sales">Sales</option> <option value="Scientific Research">Scientific Research</option> <option value="Social Care/Services">Social Care/Services</option> <option value="Telecoms/Datacoms">Telecoms/Datacoms</option> <option value="Transport/Logistics">Transport/Logistics</option> <option value="Warehouse/Industrial">Warehouse/Industrial</option> <option>Other</option> </select> </font></td> </tr> <tr> <td height="21"></td> <td></td> </tr> </table> <p align="center"><font color="#C0C0C0"> <input TYPE="submit" VALUE="Send" name="Send"> <input TYPE="reset" VALUE="Reset" name="Reset"> </font></p> </form></td> </tr> <tr> <td height="20" colspan="3" align="center" valign="middle" bgcolor="#000033"><font color="#FFFFFF" size="1.5" face="Verdana">Home</font><font color="#FFFFFF" size="1.5" face="Verdana">:Terms :E-mail</font></td> </tr> </table> <div align="left"></div> </body> </html> <-----ASP Email Script------> <% Response.Buffer = true Function BuildUpload(RequestBin) PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") Pos = InstrB(BoundaryPos,RequestBin,getByteString("Conte nt-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filen ame=")) PosBound = InstrB(PosEnd,RequestBin,boundary) If PosFile<>0 AND (PosFile<PosBound) Then PosBeg = PosFile + 10 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) UploadControl.Add "FileName", FileName Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:")) PosBeg = Pos+14 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) UploadControl.Add "ContentType",ContentType PosBeg = PosEnd+4 PosEnd = InstrB(PosBeg,RequestBin,boundary)-2 Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg) Else Pos = InstrB(Pos,RequestBin,getByteString(chr(13))) PosBeg = Pos+4 PosEnd = InstrB(PosBeg,RequestBin,boundary)-2 Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) End If UploadControl.Add "Value" , Value UploadRequest.Add name, UploadControl BoundaryPos=InstrB(BoundaryPos+LenB(boundary),Requ estBin,boundary) Loop End Function Function getByteString(StringStr) For i = 1 to Len(StringStr) char = Mid(StringStr,i,1) getByteString = getByteString & chrB(AscB(char)) Next End Function Function getString(StringBin) getString ="" For intCount = 1 to LenB(StringBin) getString = getString & chr(AscB(MidB(StringBin,intCount,1))) Next End Function If request("Action")="1" then Response.Clear byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUpload(RequestBin) 'Create the file, change the path to the path U use for temp storage of the file 'make sure you have the IUSR_YOURCOMPUTER granted WRITE access to the uploads dir If UploadRequest.Item("blob").Item("Value") <> "" Then contentType = UploadRequest.Item("blob").Item("ContentType") filepathname = UploadRequest.Item("blob").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) FolderName = UploadRequest.Item("where").Item("Value") Path = Mid(Request.ServerVariables("PATH_TRANSLATED"), 1, Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(Request.ServerVariables("PATH_INFO"))) ToFolder = Path & "\" & FolderName value = UploadRequest.Item("blob").Item("Value") filename = ToFolder & "\" & filename Set MyFileObject = Server.CreateObject("Scripting.FileSystemObject") Set objFile = MyFileObject.CreateTextFile(filename) For i = 1 to LenB(value) objFile.Write chr(AscB(MidB(value,i,1))) Next objFile.Close Set objFile = Nothing Set MyFileObject = Nothing End If Title = UploadRequest.Item("Title").Item("Value") FirstName = UploadRequest.Item("First_Name").Item("Value") LastName = UploadRequest.Item("Last_Name").Item("Value") Building_No_Name = UploadRequest.Item("Building_No_Name").Item("Value ") Street = UploadRequest.Item("Street").Item("Value") Town = UploadRequest.Item("Town").Item("Value") County = UploadRequest.Item("County").Item("Value") Postcode = UploadRequest.Item("Postcode").Item("Value") Telephone_Number = UploadRequest.Item("Telephone_Number").Item("Value ") Mobile_Number = UploadRequest.Item("Mobile_Number").Item("Value") Work_Number = UploadRequest.Item("Work_Number").Item("Value") Email_Address = UploadRequest.Item("Email_Address").Item("Value") Sector = UploadRequest.Item("Sector").Item("Value") Set UploadRequest = Nothing body="<html><body><p align='center'><font size='5' face='Times New Roman' color='#0000FF'>Candidate Registration Form </font></p>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Title: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Title & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>First Name: </td><td><font size='3' face='Times New Roman' color='#660033'>" & first_Name & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Last Name: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Last_Name & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Building Name/Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Building_No_Name & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Street: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Street & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Town: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Town & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>County: </td><td><font size='3' face='Times New Roman' color='#660033'>" & County & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Postcode: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Postcode & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Telephone Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Telephone_Number & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Mobile Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Mobile_Number & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Work Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Work_Number & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Email Address: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Email_Address & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Sector: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Sector & "</td></tr>" body = body & "</table></body></html>" Set objCDOMail = Server.CreateObject("CDONTS.NewMail") ObjCDOMail.From = Email_Address ObjCDOMail.To = "steve.owens@rslsteeper.com" ObjCDOMail.BodyFormat = 0 ObjCDOmail.Mailformat = 0 ObjCDOMail.Subject = "Candidate Registration Form" & MyPosition ObjCDOMail.Body = body If Len(filename) > 5 then ObjCDOMail.AttachFile filename,nikfile end if ObjCDOMail.Send Set ObjCDOMail = Nothing ' Now the file in the uploads dir can be deleted Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFile filename set fso = nothing End If %> <html> <script language='javascript'> alert("Thank You for Registering Yor Resume"); location.replace("index.htm"); </script> </html> please can some one tell me why it wont work or can they help me fix it? |
|
||||
|
Can you be more specific as to WHY it wont work....
IE. What is happening.... what error messages are you getting? I can see that you need to change this line in your form:- <input name="CV" type="file" id="CV"> to this:- <input name="blob" type="file" id="blob">
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
i am getting the java message at the end but i am not recieving any emails
it would not work at all when i had the *.asp?ACTION=1" so when i took of the ?ACTION=1" it ran the java script at the end but still did not get any email |
|
||||
|
try changing this:-
<form METHOD="POST" ENCTYPE="multipart/form-data" action="cvupload.asp" name="mailform" id="mailform"> to this:- <form METHOD="POST" ENCTYPE="multipart/form-data" action="cvupload.asp?action=1" name="mailform" id="mailform"> you need the action=1 for it to send email. If you get error msg's... can you tell me what they are.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Can we look at my script again then
<--------the cgi script---------> <% Response.Buffer = true Function BuildUpload(RequestBin) PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") Pos = InstrB(BoundaryPos,RequestBin,getByteString("Conte nt-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filen ame=")) PosBound = InstrB(PosEnd,RequestBin,boundary) If PosFile<>0 AND (PosFile<PosBound) Then PosBeg = PosFile + 10 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) UploadControl.Add "FileName", FileName Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:")) PosBeg = Pos+14 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) UploadControl.Add "ContentType",ContentType PosBeg = PosEnd+4 PosEnd = InstrB(PosBeg,RequestBin,boundary)-2 Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg) Else Pos = InstrB(Pos,RequestBin,getByteString(chr(13))) PosBeg = Pos+4 PosEnd = InstrB(PosBeg,RequestBin,boundary)-2 Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) End If UploadControl.Add "Value" , Value UploadRequest.Add name, UploadControl BoundaryPos=InstrB(BoundaryPos+LenB(boundary),Requ estBin,boundary) Loop End Function Function getByteString(StringStr) For i = 1 to Len(StringStr) char = Mid(StringStr,i,1) getByteString = getByteString & chrB(AscB(char)) Next End Function Function getString(StringBin) getString ="" For intCount = 1 to LenB(StringBin) getString = getString & chr(AscB(MidB(StringBin,intCount,1))) Next End Function If request("Action")="1" then Response.Clear byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUpload(RequestBin) 'Create the file, change the path to the path U use for temp storage of the file 'make sure you have the IUSR_YOURCOMPUTER granted WRITE access to the uploads dir If UploadRequest.Item("blob").Item("Value") <> "" Then contentType = UploadRequest.Item("blob").Item("ContentType") filepathname = UploadRequest.Item("blob").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) FolderName = UploadRequest.Item("where").Item("Value") Path = Mid(Request.ServerVariables("PATH_TRANSLATED"), 1, Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(Request.ServerVariables("PATH_INFO"))) ToFolder = Path & "\" & FolderName value = UploadRequest.Item("blob").Item("Value") filename = ToFolder & "\" & filename Set MyFileObject = Server.CreateObject("Scripting.FileSystemObject") Set objFile = MyFileObject.CreateTextFile(filename) For i = 1 to LenB(value) objFile.Write chr(AscB(MidB(value,i,1))) Next objFile.Close Set objFile = Nothing Set MyFileObject = Nothing End If Title = UploadRequest.Item("Title").Item("Value") FirstName = UploadRequest.Item("First_Name").Item("Value") LastName = UploadRequest.Item("Last_Name").Item("Value") Building_No_Name = UploadRequest.Item("Building_No_Name").Item("Value ") Street = UploadRequest.Item("Street").Item("Value") Town = UploadRequest.Item("Town").Item("Value") County = UploadRequest.Item("County").Item("Value") Postcode = UploadRequest.Item("Postcode").Item("Value") Telephone_Number = UploadRequest.Item("Telephone_Number").Item("Value ") Mobile_Number = UploadRequest.Item("Mobile_Number").Item("Value") Work_Number = UploadRequest.Item("Work_Number").Item("Value") Email_Address = UploadRequest.Item("Email_Address").Item("Value") Sector = UploadRequest.Item("Sector").Item("Value") Set UploadRequest = Nothing body="<html><body><p align='center'><font size='5' face='Times New Roman' color='#0000FF'>Candidate Registration Form </font></p>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Title: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Title & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>First Name: </td><td><font size='3' face='Times New Roman' color='#660033'>" & first_Name & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Last Name: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Last_Name & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Building Name/Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Building_No_Name & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Street: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Street & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Town: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Town & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>County: </td><td><font size='3' face='Times New Roman' color='#660033'>" & County & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Postcode: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Postcode & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Telephone Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Telephone_Number & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Mobile Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Mobile_Number & "</td></tr>" body=body & "<table align='center'> <tr><td><font size='3' face='Times New Roman' color='#660033'>Work Number: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Work_Number & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Email Address: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Email_Address & "</td></tr>" body=body & "<table align='center'><tr><td><font size='3' face='Times New Roman' color='#660033'>Sector: </td><td><font size='3' face='Times New Roman' color='#660033'>" & Sector & "</td></tr>" body = body & "</table></body></html>" Set objCDOMail = Server.CreateObject("CDONTS.NewMail") ObjCDOMail.From = Email_Address ObjCDOMail.To = "steve.owens@rslsteeper.com" ObjCDOMail.BodyFormat = 0 ObjCDOmail.Mailformat = 0 ObjCDOMail.Subject = "Candidate Registration Form" & MyPosition ObjCDOMail.Body = body If Len(filename) > 5 then ObjCDOMail.AttachFile filename,nikfile end if ObjCDOMail.Send Set ObjCDOMail = Nothing ' Now the file in the uploads dir can be deleted Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFile filename set fso = nothing End If %> <html> <script language='javascript'> alert("Thank You for Registering Yor Resume"); location.replace("index.htm"); </script> </html> |
|
||||
|
It may be very useful if you turn off friendly http error messages, so you can see the real cause of errors...
To do, in internet explorer, click on the tools menu, and then internet options. Click on the advanced Tab. One of the tick boxes there says 'show friendly HTTP error messages' ... UNTICK THAT. This may help you either diagnose what is going wrong.... or at least allow you to copy / paste the error message here. Cheers,
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|