Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Non capisco una cosa....

    Ragazzi, ho messo lo script asp per la registrazione clienti.
    Per l'invio della mail di conferma iscrizione, ho usato il tuo cdosys, e, dopo aver compilato il form, esce tranquillamente e correttamente la conferma:
    _________________________________
    Grazie per la registrazione!
    Controlla la tua email per confermare la registrazione.
    ____________________________________

    In realtà poi la mail non giunge mai a destinazione!
    Come mai? Infatti dove è che devo mettere la user e la password per fare inviare l'email tramite asp?

    Grazie!
    Roberto Pietrafesa
    email: roberto@pietrafesa.net
    cellulare: +39 388-0000737

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    1) Posta lo script
    2) Dai dei titoli decenti ai thread se desideri che qualcuno ti risponda, come da regolamento del resto

    Roby

  3. #3
    Scusami per il titolo!
    Lo script è qui di seguito!

    Quello che succede è che, se una persona si registra, la mail per conferma iscrizione (quella nella quale bisogna cliccare il link prestampato) anzicchè giungere all'indirizzo della persona, giunge all'indirizzo messo nelle impostazioni dell'amministratore, ovvero quell'indirizzo dal quale dovrebbe partire la mail indirizzata alla persona.

    Grazie Roby!

    = "------------------------------------------" & vbCrLf & _
    "Grazie per esserti registrato, " & strRecipientsName & "! Per completare la registrazione, inserisci un indirizzo email valido." & vbCrLf & _
    "Per completare la registrazione, clikka sul seguente indirizzo:" & vbCrLf & _
    " " & homePage & curSubFolders & "attivo.asp?userCode=" & str_new_usercode & vbCrLf & vbCrLf & _
    "Grazie," & vbCrLf & pageTitle & " Webmaster"

    Select Case LCase(tipoMail)
    Case "aspemail"
    Set objNewMail = Server.CreateObject("Persits.MailSender")
    objNewMail.Host = mailServer
    objNewMail.FromName = strFromName
    objNewMail.AddReplyTo strFromEmail
    objNewMail.From = strFromEmail
    objNewMail.AddAddress strRecipientsEmail, strRecipientsName
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    On Error Resume Next '## Ignora Errore
    objNewMail.Send
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email: " & Err.Description & ""
    End if
    Case "aspmail"
    Set objNewMail = Server.CreateObject("SMTPsvg.Mailer")
    objNewMail.FromName = strFromName
    objNewMail.FromAddress = strFromEmail
    'objNewMail.AddReplyTo = strFromEmail
    objNewMail.RemoteHost = mailServer
    objNewMail.AddRecipient strRecipientsName, strRecipientsEmail
    objNewMail.Subject = strSubject
    objNewMail.BodyText = strMessage
    On Error Resume Next '## Ignora Errore
    SendOk = objNewMail.SendMail
    If not(SendOk) <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & objNewMail.Response & ""
    End if
    Case "cdonts"
    Set objNewMail = Server.CreateObject ("CDONTS.NewMail")
    objNewMail.BodyFormat = 1
    objNewMail.MailFormat = 0
    On Error Resume Next '## Ignora Errore
    objNewMail.Send strFromEmail, strRecipientsEmail, strSubject, strMessage
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    On Error Resume Next '## Ignora Errore

    Case "cdosys"
    Set objMessage = CreateObject("CDO.Message")
    objMessage.Sender = strFromEmail
    objMessage.TextBody = strMessage
    objMessage.To = strFromEmail
    objMessage.Subject = strSubject
    objMessage.Send
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    On Error Resume Next '## Ignora Errore



    Case "chilicdonts"
    Set objNewMail = Server.CreateObject ("CDONTS.NewMail")
    On Error Resume Next '## Ignora Errore
    objNewMail.Host = mailServer
    objNewMail.To = strRecipientsEmail
    objNewMail.From = strFromEmail
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    objNewMail.Send
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    On Error Resume Next '## Ignora Errore
    Case "jmail"
    Set objNewMail = Server.CreateObject("Jmail.smtpmail")
    objNewMail.ServerAddress = mailServer
    objNewMail.AddRecipient strRecipientsEmail
    objNewMail.Sender = strFromEmail
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    objNewMail.Priority = 3
    On Error Resume Next '## Ignora Errore
    objNewMail.Execute
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    Case "jmail4"
    Set objNewMail = Server.CreateObject("Jmail.Message")
    'objNewMail.MailServerUserName = "username@dominio.it"
    'objNewMail.MailServerPassword = "password"
    objNewMail.From = strFromEmail
    objNewMail.FromName = strFromName
    objNewMail.AddRecipient strRecipientsEmail, strRecipientsName
    objNewMail.Subject = strSubject
    objNewMail.Body = strMessage
    On Error Resume Next '## Ignora Errore
    objNewMail.Send(mailServer)
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    Case "smtp"
    Set objNewMail = Server.CreateObject("SmtpMail.SmtpMail.1")
    objNewMail.MailServer = mailServer
    objNewMail.Recipients = strRecipientsEmail
    objNewMail.Sender = strFromEmail
    objNewMail.Subject = strSubject
    objNewMail.Message = strMessage
    On Error Resume Next '## Ignora Errore
    objNewMail.SendMail2
    If Err <> 0 Then
    Err_Msg = Err_Msg & "[*]Impossibile spedire l'email. Errore: " & Err.Description & ""
    End if
    End Select
    Set objNewMail = Nothing
    On Error Goto 0


    Response.Redirect("benvenuto.asp")
    Else
    Session("tmpUN") = new_name
    Response.Redirect("login.asp?disp=login")
    End If
    End If
    End If
    %>
    <!doctype html public "-//w3c//dtd html 3.2//en"><html>

    <head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function DoSubmit(obj) {
    var nome = obj.nome.value;
    var cognome = obj.cognome.value;
    var username = obj.username.value;
    var password = obj.pw1.value;
    var confirmation = obj.pw2.value;
    var email = obj.email.value;
    var citta = obj.citta.value;
    var cap = obj.cap.value;
    var strMailFilter = /^.+@.+\..{2,3}$/;
    var strIllegalChars = /[\(\)\<\>\,\;\:\\\/\*\-\+\=\"\[\]]/;

    var submitform = true;
    var error = '************************* REGISTRAZIONE *************************\n\n';
    error += ' Attenzione : \n\n';

    if (nome.length < 3 ) {
    error += ' + Nome è un campo richiesto \n';
    submitform = false;
    }
    if (nome.length > 20 && isNaN(nome) ) {
    error += ' + Nome può essere massimo 20 caratteri \n';
    submitform = false;
    }
    if (nome.length > 1 && nome.match(strIllegalChars) ) {
    error += ' + Nome contiene caratteri non consentiti \n';
    submitform = false;

    }


    if (cognome.length < 1) {
    error += ' + Cognome è un campo obbligatorio \n';
    submitform = false;
    }

    if (cognome.length > 20 ) {
    error += ' + Cognome può essere massimo 20 caratteri \n';
    submitform = false;
    }
    if (cognome.length > 1 && cognome.match(strIllegalChars)) {
    error += ' + Cognome contiene caratteri non consentiti \n';
    submitform = false;
    }


    if (username.length < 1) {
    error += ' + Username è una campo richiesto \n';
    submitform = false;
    }
    if (username.length > 20) {
    error += ' + Username può essere massimo 20 caratteri \n';
    submitform = false;
    }
    if (username.length > 1 && username.match(strIllegalChars)) {
    error += ' + Nome contiene caratteri non consentiti \n';
    submitform = false;
    }

    if (password.length < 5) {
    error += ' + Password deve essere minimo 5 caratteri \n';
    submitform = false;
    }
    if (password.length > 20) {
    error += ' + Password può essere massimo 20 caratteri \n';
    submitform = false;
    }
    if (confirmation.length < 1) {
    error += ' + Conferma password è un campo obbligatorio \n';
    submitform = false;
    }
    if (password != confirmation) {
    error += ' + Password non è uguale \n';
    submitform = false;
    }
    if (email.length < 1) {
    error += ' + Email è un campo obbligatorio \n';
    submitform = false;
    }

    if (email.length > 30) {
    error += ' + Email è massimo 30 caratteri \n';
    submitform = false;
    }
    if (email.length > 1 && email.match(strIllegalChars)) {
    error += ' + Email contiene caratteri non consentiti \n';
    submitform = false;
    }
    if (email.length > 1 && !email.match(strIllegalChars) && !(strMailFilter.test(email))) {
    error += ' + Email non è valida \n';
    submitform = false;
    }

    if (citta.length < 3 ) {
    error += ' + Citta è un campo richiesto \n';
    submitform = false;
    }
    if (citta.length > 15 ) {
    error += ' + Citta può essere massimo 15 caratteri \n';
    submitform = false;
    }
    if (citta.length > 1 && citta.match(strIllegalChars)) {
    error += ' + Citta contiene caratteri non consentiti \n';
    submitform = false;
    }

    if (cap.length < 4 ) {
    error += ' + Cap è un campo richiesto \n';
    submitform = false;
    }

    if (cap.length > 4 && isNaN(cap) ) {
    error += ' + Cap contiene caratteri non consentiti \n';
    submitform = false;
    }

    if (submitform) {
    obj.submit();
    }
    else {
    error += '\n************************* REGISTRAZIONE *************************\n\n';
    alert (error);
    return false;
    }
    }
    -->
    </script>
    <LINK href="css/file.css" type=text/css rel=stylesheet>
    </head>

    <title><%=pageTitle%>Tecnoprotezioni - soluzioni per la sicurezza. Registrazione clienti. </title>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="14">
    <tr>
    <td width="100%" height="14"> [img]/images/registrazione.gif[/img]</td>
    </tr>
    </table>


    <form name="registrationForm" method="post" action="registrazione.asp?step=2" onReset="return confirm('Sei sicuro di voler cancellare tutti i dati nel form?')">
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="black" width="100%">
    <tr>
    <td width="100%" colspan="2">I campi contrassegnati con * sono obbligatori.</td>
    </tr>
    <tr>
    <td width="100%" height="8" colspan="2"></td>
    </tr>
    <tr>
    <td>

    <% If emptyValue = True AND new_nome = "" Then %>
    <font color="#000000">
    <% End If %>
    Nome
    <% If emptyValue = True AND new_nome = "" Then %>
    </font>
    <% End If %>
    *
    </td>
    <td width="100%"> <input name="nome" value="<%=new_nome%>" size="30" maxlength="20"></td>
    </tr>
    <tr>
    <td></td>
    <td width="100%"></td>
    </tr>
    <tr>
    <td height="8">[img]/images/trans.gif[/img]</td>
    <td height="8" width="100%"></td>
    </tr>
    <tr>
    <td>
    <% If emptyValue = True AND new_cognome = "" Then %>
    <font color="#000000">
    <% End If %>
    Cognome
    <% If emptyValue = True AND new_cognome = "" Then %>
    </font>
    <% End If %>
    *
    </td>
    <td width="100%"> <input name="cognome" value="<%=new_cognome%>" size="30" maxlength="20"></td>
    </tr>
    <tr>
    <td></td>
    <td width="100%"></td>
    </tr>
    <tr>
    <td height="8">[img]/images/trans.gif[/img]</td>
    <td height="8" width="100%"></td>
    </tr>
    <tr>
    <td>
    <% If emptyValue = True AND new_name = "" Then %>
    <font color="#000000">
    <% End If %>
    Username
    <% If emptyValue = True AND new_name = "" Then %>
    </font>
    <% End If %>
    *
    </td>
    <td width="100%"> <input name="username" type="text" value="<%=new_name%>" size="30" maxlength="20"></td>
    Roberto Pietrafesa
    email: roberto@pietrafesa.net
    cellulare: +39 388-0000737

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Qui

    objMessage.To = strFromEmail

    devi mettere la variabile che contiene la mail del destinatario.
    Non so quale sia.

    Roby

  5. #5
    Vai con Dio, funziona Roby!!!

    Tenchiu' veri mach indid!
    Roberto Pietrafesa
    email: roberto@pietrafesa.net
    cellulare: +39 388-0000737

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.