Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Invio email

  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    113

    Invio email

    Salve a tutti, ho un problema che, suppongo, sia abbastanza banale ma che mi sta facendo uscire pazzo

    Ho un form da cui carico alcuni dati da un database per la visualizzazione

    codice:
    <%
      Set Conn = Server.CreateObject("adodb.connection")
      Conn.Open = "DRIVER={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/mdb-database/db.mdb")
      Sql = "SELECT * FROM db WHERE ID=" & session("id")
      Set Rs = Conn.Execute(Sql)
      %>
      <form method="post">
      <table cellspacing="2" cellpadding="1" height="80%" width="90%" border="0" align="center">
        <tr> 
                <td class="testo">Nome :</td>
                <td><input class="contact" type="text" size="40" value="<%= rs("nome") %>" readonly></td>
              </tr>
              <tr> 
                <td class="testo">Cognome :</td>
                <td><input class="contact" type="text" size="40" value="<%= rs("cognome") %>" readonly></td>
              </tr>
              <tr> 
                <td class="testo">Email :</td>
                <td><input class="contact" type="text" size="40" value="<%= rs("email") %>" readonly></td>
              </tr>
          <td colspan="2" class="small" align="center" valign="middle">
       <input name="button" class="contact" style="background-color:#ffffff" type="button" onclick="location.href('InvioAttivazione.asp');" value="Invia l'attivazione &gt;&gt;">
            </table>
      </form>
    e questi dati devono poi essere inviati via email con questo codice che sarebbe InvioAttivazione.asp

    codice:
    <% 
    nome = request("nome")
    cognome = request("cognome")
    email = request("email")
    HTML = ""
    HTML = HTML&"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
    HTML = HTML&"<html><head><title>Richiesta Attivazione</title></head>"
    HTML = HTML&"<body>"
    HTML = HTML&"<table cellspacing=""15"" cellpadding=""1"" width=""80%"" align=""left""><tr><td>"
    HTML = HTML&"<br><br><table width=""100%"" align=""left"">"
    HTML = HTML&"<tr><td colspan=""2""><font face=""Arial"" ><b>Dati del richiedente:</b></font></td></tr>"
    HTML = HTML&"<tr><td bgcolor=""#e3e3e3""><font face=""Arial"" size=""-1"">Nome :</font>"
    HTML = HTML&"</td><td td bgcolor=""#ffffff""><font face=""Arial"" size=""-1"">"&nome&"</font></td></tr>"
    HTML = HTML&"<tr><td td bgcolor=""#e3e3e3""><font face=""Arial"" size=""-1"">Cognome :</font>"
    HTML = HTML&"</td><td td bgcolor=""#ffffff""><font face=""Arial"" size=""-1"">"&cognome&"</font></td></tr>"
    HTML = HTML&"</table></td></tr>"
     HTML = HTML&"<tr><td bgcolor=""#e3e3e3""><font face=""Arial"" size=""-1"">Email :</font>"
    HTML = HTML&"</td><td td bgcolor=""#ffffff""><font face=""Arial"" size=""-1"">"&email&"</font></td></tr>"
    HTML = HTML&"</table></td></tr>
    HTML = HTML&"</table>"
    HTML = HTML&"</body></html>"
    'invio la mail
    Set objMessage = Server.CreateObject("CDO.Message")
       objMessage.Subject = "Richiesta di Attivazione"
       objMessage.From = "info@sitointernet.it"
       objMessage.To = "prova@sitointernet.it"
       objMessage.HTMLBody = html
       objMessage.Send
    Set objMessage = Nothing 
    
    if err.number <> 0 then
     response.redirect("KO.asp")
    else
     response.redirect("OK.asp")
    end if
    %>
    Mi invia la mail ma è completamente vuota, senza nessun dato, come mai secondo voi?
    Grazie mille per l'aiuto

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Il tuo form non esegue il SUBMIT ma è un semplice link... quindi non recupera nulla.

    Dovrei avere qualcosa tipo:
    <form method="post" action="InvioAttivazione.asp">
    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.