Salve a tutti, io non so niente di ASP però ho trovato questo script che sembra funzionare, nel senso che non dà nessun errore su l'invio della mail compilando i vari campi e mi dice mail inviata. Solo che, testandolo online, ancora non mi è arrivata nessuna mail !
Dipende dal codice?
codice:<%@ Language = "VBScript" %> <% Select Case Request.Querystring("Action") Case "Send" on error resume next 'Set variables Dim BackURL Dim strName Dim strEmail Dim strSubject Dim strMessage Dim strUserIP Dim strToEmail Dim daCdoMail 'Replace this email with your real email id strToEmail = "info@digitalarakan.net" BackURL = Request.ServerVariables("HTTP_REFERER") strName = Request.form("Name") strEmail = Request.form("Email") strSubject = Request.form("Subject") strMessage = Request.form("Message") strUserIP = Request.ServerVariables("REMOTE_ADDR") 'Create Mail Object Set daCdoMail = CreateObject("CDONTS.NewMail") daCdoMail.To = strToEmail daCdoMail.From = strEmail daCdoMail.Subject = strSubject daCdoMail.Body = "<font size=""small"">This message was sent by " & strName & " at " & Now() & ". </font> " & strMessage & _ "<hr height=""1""><font size=""2"">ASP Contact Form Script Powered by <font color=""#FF0000"">DigitalArakan</font> " & _ "</font>http://<a href="http://www.digitalar...net</a></font>" 'You can change the mail body format setting below '0 = HTML, 1 = TEXT daCdoMail.BodyFormat = 0 'You can change the mail format setting below '0 = HTML, 1 = TEXT daCdoMail.MailFormat = 0 'Set Server Side Validation to make sure we got both sender and recipient email Id to send email If strToEmail = "" OR strEmail = "" Then Session("msg") = "Sender Email or Resipient Email is blank. This message can not be sent. Please try again" Response.redirect (BackURL) Else 'Now send email to the address you specified at line no. 16 daCdoMail.Send End If 'Destroy mail object Set daCdoMail = Nothing 'Create result text in a Sesion Session("MsgSent") = "Your email with subject [" & strSubject & "] has been sent. Thank you for writing to us." 'Redirect and show the result Response.redirect (BackURL) End Select %> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>ASP Contact Form Version 1 Powered by DigitalArakan</title> <meta name="Naing Win - DigitalArakan - http://www.digitalarakan.net" content="Author"> <SCRIPT language=javascript> function check() { if (document.myform.Name.value.length==0) { alert("Please enter your Name"); document.myform.Name.focus(); } else if(document.myform.Email.value.length==0 || document.myform.Email.value.indexOf("@")==-1 || document.myform.Email.value.indexOf(".")==-1 || document.myform.Email.value.indexOf(" ")==0) { alert("You must enter a Valid Email ID") document.myform.Email.focus(); } else if (document.myform.Subject[document.myform.Subject.selectedIndex].value.length==0) { alert("Please select a Subject"); document.myform.Subject.focus(); } else if(document.myform.Message.value==0) { alert("Message field cannot be left empty"); document.myform.Message.focus(); } else { document.myform.submit() } } </SCRIPT> <style> <!-- h3 { font-family: Tahoma; font-size: 14pt; color: #003399; font-weight: bold } td { font-family: Tahoma; font-size: 11pt } --> </style> </head> <body> <%If Session("msgSent") = "" Then%> <table cellSpacing="1" border="0" bordercolor="#111111" id="table1" width="100%"> <form action="Contact.asp?Action=Send" method="post" name="myform"> <tr> <td align="right" colspan="2"> <h3 align="left">Contact Form</h3> </td> </tr> <tr> <td colspan="2"> If you want to contact us for any questions or suggestions, then please fill the form correctly and send it to us by hitting the 'Send Message' button.</td> </tr> <%If Session("msg") <> "" Then%> <tr> <td colspan="2"> <font size="1" color="#FF0000"><%=Session("msg")%></font></td> </tr> <%End If%> <tr> <td colspan="2"> </td> </tr> <tr> <td class="nortex">Your Name:</td> <td class="nortex"> <input maxLength="25" size="37" name="Name" value="<%= Request.form("Name") %>"></td></tr> <tr> <td class="nortex">Your Email:</span></td> <td class="nortex"> <input maxLength="25" size="37" name="Email" value="<%= Request.form("Email") %>"></td></tr> <tr> <td class="nortex">Subject:</td> <td class="nortex"><select name="Subject"> <option selected>Select Subject</option> <option value="Question">Question</option> <option value="Suggestion">Suggestion</option> <option value="Broken Link" Links>Broken Links</option> <option value="None of the above" of the above>None of the above</option></select> </td></tr> <tr> <td class="nortex" valign="top">Your Message:</td> <td class="nortex"> <textarea name="Message" rows="12" cols="48"><%= Request.form("Message") %></textarea></td></tr> <tr> <td class="nortex"></td> <td class="nortex"> <input onClick="check()" type="button" value="Send Message" name="sendmessage" style="float: center; font-weight:bold"></td></tr> <tr> <td class="nortex" colspan="2"></td> </tr> <tr> <td class="nortex" colspan="2"> <% 'DO NOT REMOVE THIS LINE Response.write " </p><p align=""center""><font size=""1"">ASP Contact Form Script Powered by <font color=""#FF0000"">DigitalArakan</font> " & _ "</font>http://<font size=""1""><a href="htt...net</a></font>" %> </td> </tr> </form> </table> <%Else%> <table cellSpacing="1" border="0" bordercolor="#111111" id="table2" width="100%"> <tr> <td align="right"> <h3 align="left">Message Sent</h3> </td> </tr> <tr> <td> <font size="1" color="#FF0000"><%=Session("MsgSent")%></font></td> </tr> <tr> <td> <% 'DO NOT REMOVE THIS LINE Response.write " </p> <p align=""center""><font size=""1"">ASP Contact Form Script Powered by <font color=""#FF0000"">DigitalArakan</font> " & _ "</font>http://<font size=""1""><a href="htt...net</a></font>" %> </td></tr> </table> <%End If 'Destroy session variables Session("MsgSent") = "" Session("msg") = "" %> </body> </html>

Rispondi quotando
] 