faraznj Posted September 1, 2010 Share Posted September 1, 2010 This forum is very active Link to comment Share on other sites More sharing options...
faraznj Posted September 1, 2010 Author Share Posted September 1, 2010 Hello guysMy server admin have written a ASP code for me for sending from value from web form to my email addresse. It's work fine only when I use normal form code, but when i want to put my form to the certainly place e.g center of page or if I want to put fields to different positions and use <div>, so ASP form processor won't send value of fields.any help!!??This is code of form:<div id="wb_Form1" style="position:absolute;left:400;top:150;width:65 4px;height:418px;"><form method="post" action="mail.asp"><p> Navn : </br><input name="Navn"></p><p>Adresse: </br><input name="Adresse"></p><p>Postnummer: </br><select name="Postnummer:"><option>4100</option><option>4200</option><option>4295</option><option>4293</option><option>4296</option></select></p><p>By: </br><input type="text" name="By:"> </p><p>Email: </br><input type="text" name="Email:"></p><p>Telefon: </br><input type="text" name="Telefon"></p><p>Problemet: </br><select name="Problemet"><option value="Hvad er fejlen...">Hvad er fejlen</option><option value="Vand">Vand</option><option value="Spildevand">spildevand</option>< option value="Tømningsordning">Tømningsordning</option><option value="Andet">Andet</option></select></p><input name="email_subject" type="hidden" value="Fejlmelding fra hjemmeside" /><input name="redirect_to" type="hidden" value="success.asp" /><p><input type="reset" name="Reset" value="Reset"><input name="send" type="submit" value="Submit"></p></form></div>--------------This is ASP mail:<%For Field = 1 to Request.Form.Count - 3FieldName = Replace(Request.Form.Key(Field),"_"," ")FieldValue = Request.Form.Item(Field)Body = Body & FieldName & ": " & FieldValue & VbCrLfNext'Dimension variablesDim objCDOSYSCon'Create the e-mail server objectSet objCDOSYSMail = Server.CreateObject("CDO.Message")Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")'Set and update fields propertiesWith objCDOSYSCon'Outgoing SMTP server.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.domain.com".Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25'CDO Port.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2'Timeout.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60.Fields.UpdateEnd With'Update the CDOSYS ConfigurationSet objCDOSYSMail.Configuration = objCDOSYSCon'Set and update email propertiesWith objCDOSYSMail'0=Low, 1=Normal, 2=High.Fields("urn:schemas:httpmail:importance").Value = 1'Who the e-mail is from.From = "ex@domain.com"'Who the e-mail is sent to.To = "example@domain.com"'Who the e-mail is CC'd to.Cc = Request.Form("email_address")'The subject of the e-mail.Subject = Request.Form("email_subject")'Set the e-mail body format (HTMLBody=HTML TextBody=Plain).TextBody = Body.Fields.Update'Send the e-mail.SendEnd With'Close the server mail objectSet objCDOSYSMail = NothingSet objCDOSYSCon = Nothing'Rederect after sending emailResponse.Redirect Request.Form("redirect_to")%>[/size][/font] Link to comment Share on other sites More sharing options...
justsomeguy Posted September 1, 2010 Share Posted September 1, 2010 It doesn't matter where you put a form on a page, as long as all of the fields are inside the form element. You can wrap the entire page in a form element if necessary. Link to comment Share on other sites More sharing options...
faraznj Posted September 7, 2010 Author Share Posted September 7, 2010 It doesn't matter where you put a form on a page, as long as all of the fields are inside the form element. You can wrap the entire page in a form element if necessary.I founded..Problem was in the first line, I must delete the first line with <div> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.