Xpoint
   [напомнить пароль]

Отправка email и доступ к переменным

Метки: [без меток]
2009-11-03 11:51:06 [обр] Станилав[досье]
сообщение промодерировано

Всем привет.
Вообщем проблема такая. Я в ASP полный ноль.
Возникла проблема к доступу к переменным.

Вот у меня есть форма отправки письма и его обработки.

=================== Форма отправки ===========================

<form action="formofferta.asp" method="post" name="form1" onSubmit="MM_validateForm('email','','RisEmail');return document.MM_returnValue">
              <table width="400" border="0" cellspacing="1px" cellpadding="0">
                <tr> 
                  <td width="270" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Nome:</font></strong></td>
                  <td width="121" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="nome" style="width:200px;">
                  </font></td>
                </tr>
                <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Cognome:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="cognome" style="width:200px;">
                  </font></td>
                </tr>
                <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Telefono:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="tel" style="width:200px;">
                  </font></td>
                </tr>
                <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Cell:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="fisso" style="width:200px;">
                  </font></td>
                </tr>
                <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Orario:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="orario" style="width:200px;">
                  </font></td>
                </tr>
                <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Citta:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="citta" style="width:200px;">
                  </font></td>
                </tr>
                 <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Provincia:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="text" name="provincia" style="width:200px;">
                   </font></td>
                </tr>
                <tr>
              
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <input type="hidden" name="email" size="20" value=noreply@bluecom-tlc.it>
                    </font></td>
                </tr>
                      <tr>
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Come ha ci conosciuto ?
                      </font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                    <select name="Conosciuto" size="1" style="width:200px;" id="Conosciuto">
             <option value="Google" >Google</option>
             <option value="Tv" selected>Tv</option>
             <option value="Altro">Altro</option>
          </select>   
                    </font></td>
                </tr>
                <tr> 
                  <td width="170" bgcolor="#0066FF"><strong><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#ffffff">Messaggio:</font></strong></td>
                  <td width="191" bgcolor="#0066FF"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif"> <font size="1"> 
                    <textarea name="messaggio" rows="5" style="width:200px;" wrap="VIRTUAL"></textarea>
                  </font></font> </td>
                </tr>
              </table>
              <p align="center"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif"> <font size="1"> 
                <input type="submit" name="Submit" value="Invia Richiesta">
              &nbsp; </font></font> </p>
            </form>
            <p></td>
        </tr>
      </table>

================== Форма отправки конец ============================================
==================formofferta.asp=======================================================


<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Type Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<%
'============Linkbruttocane su specifiche MSDN================
'*   il corpo finale del messaggio contiene tutti i campi    *
'*   inseriti nella pagina html, in pratica puoi mettere     *
'*   tutti i campi che ti servono nel modulo di invio senza  *
'*   fare altre configurazioni aggiuntive.                   *  
'=============================================================

DIM corpoMessaggio, numeroCampi, invioA, invioDa, nomeDominio, indirizzoIp, modulo, browserSistemaOperativo

   '* voce da modificare con il proprio indirizzo email
   
invioA =  "youremail@hosting.com"

   '* voce da modificare con un indirizzo email che funga da mittente: 
   '* in caso di errore riceverete notifica a questo indirizzo un MAILER-DAEMON
   '* dato che cdosys supporta questa notifica
      
invioDa =  "youremail@hosting.com"

'------------fine modifiche necessarie------------------

nomeDominio             = Request.ServerVariables("HTTP_HOST")
indirizzoIp               = Request.ServerVariables("REMOTE_ADDR") 
modulo                  = Request.ServerVariables("HTTP_REFERER")
browserSistemaOperativo      = Request.ServerVariables("HTTP_USER_AGENT")

   '*rilevo i campi del form
   
FOR numeroCampi = 1 TO (Request.Form.Count() - 1)
   IF NOT Request.Form(numeroCampi) = "" THEN
      corpoMessaggio = corpoMessaggio & vbCrLf & Request.Form.Key(numeroCampi) & " = " & Trim(Request.Form(numeroCampi))
   END IF
NEXT

   '* creo gli oggetti cdosys sul server e li gestisco
   
DIM iMsg, Flds, iConf

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "smtp.aruba.it" 
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
Flds.Update

With iMsg
   Set .Configuration = iConf
   .To = invioA
   .From = Request.Form("email")
   .Sender = invioDa
   .Subject = "Contatto dal dominio " & nomeDominio
   .TextBody = "Questi i dati inseriti nel modulo presente alla pagina " & modulo & " da utente con indirizzo IP " & indirizzoIp & "  browser e sistema operativo " & browserSistemaOperativo  & vbCrLf & corpoMessaggio & ""
   .Send
End With
%> 
<script>
document.location.replace('grazie.asp');
</script>

==================================== end ==================================

как мне получить доступ к переменным Telefon Nome Cognome ?

Письмо приходит ввиде

Telefono = Value
Nome = Value

И так в столбик все переменный.. а я хочу сделать их по своему т.е расставить и сделать в таблице.

спустя 1 час 16 минут [обр] Станилав[досье]
Помогите ((
спустя 8 часов [обр] Василий Свиридов(47/175)[досье]
Строка Request.Form("email") в коде должна наводить на некоторые мысли.
Powered by POEM™ Engine Copyright © 2002-2005