Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 17

Discussione: Problema Con Phpmailer

  1. #1

    Problema Con Phpmailer

    Salve ragazzi ho dei problemi con phpmailer
    io dovrei inviare una mail automatica di ringraziamento dopo che l'utente ha riempito e inviato un form nel sito,
    ora io ho fatto cosi:
    Questo è il form
    Codice PHP:

    <div class="class_div_mail">
      <
    form id="form1" name="prova_gratis" method="POST" action="PHPMailer/config_mail.php">
        <
    label for="nome">Nome</label>
        

        <
    input type="text" name="nome" id="nome"/>
        <
    label for="cognome">

          
    Cognome</label>
        

        <
    input type="text" name="cognome" id="cognome" />
        <
    label for="email">

          
    Email</label>
        

        <
    input type="text" name="email" id="email" />
        

        <
    label for="telefono"Telefono</label>
        

        <
    input type="text" name="telefono" id="telefono" />
        <
    label for="attivita">

          
    Attività

        
    </label>
        <
    select name="attivita" id="attivita">
          <
    option value="" selected="selected">Scegli.......</option>
          <
    option value="Stretching">Stretching</option>
          <
    option value="Total Body">Total Body</option>
          <
    option value="Soft Pilates">Soft Pilates</option>
          <
    option value="Tone Pilates">Tone Pilates</option>
          <
    option value="Pilates">Pilates</option>
          <
    option value="Gym Soft">Gym Soft</option>
          <
    option value="Yoga - (De Rose)">Yoga - (De Rose)</option>
          <
    option value="Ginnastica Posturale">Ginnastica Posturale</option>
          <
    option value="Spinning">Spinning</option>
          <
    option value="Tonificazione">Tonificazione</option>
          <
    option value="Interval Training">Interval Training</option>
          <
    option value="Total Work Out">Total Work Out</option>
          <
    option value="Body Sculpt">Body Sculpt</option>
          <
    option value="Total Body">Total Body</option>
          <
    option value="Step Coreografico">Step Coreografico</option>
          <
    option value="Corpo Libero">Corpo Libero</option>
          <
    option value="G.a.g.">G.a.g.</option>
        </
    select>
        

        

        <
    input type="submit" name="Submit" value="Invia!" />
        <
    input type="reset" name="Submit2" value="Cancella" />
        <
    input type="hidden" name="MM_insert" value="prova_gratis" />
      </
    form>
    </
    div
    e Questa è la mia pgina di config

    Codice PHP:
    <?php require_once('../../Connections/fitnesscenter.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function 
    GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
    {
      if (
    PHP_VERSION 6) {
        
    $theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }

      
    $theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

      switch (
    $theType) {
        case 
    "text":
          
    $theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
          break;    
        case 
    "long":
        case 
    "int":
          
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case 
    "double":
          
    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case 
    "date":
          
    $theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
          break;
        case 
    "defined":
          
    $theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
          break;
      }
      return 
    $theValue;
    }
    }

    mysql_select_db($database_fitnesscenter$fitnesscenter);
    $query_Rs_mail "SELECT nome, cognome, email, attivita FROM prova_gratis ORDER BY id DESC";
    $Rs_mail mysql_query($query_Rs_mail$fitnesscenter) or die(mysql_error());
    $row_Rs_mail mysql_fetch_assoc($Rs_mail);
    $totalRows_Rs_mail mysql_num_rows($Rs_mail);

    $nome $_POST['nome']; 
    $cognome $_POST['cognome']; 
    $telefono $_POST['telefono']; 
    $email $_POST['email']; 
    $attivita $_POST['attivita']; 
    require_once 
    'class.phpmailer.php';
    $mail = new PHPMailer();
      
    // set mailer to use SMTP 
    $mail->Host "";  // specify main and backup server 
    $mail->Username "";  // SMTP username 
    $mail->Password ""// SMTP password 
    $mail->From     'info@mdstudioweb.com'
    $mail->FromName 'info@mdstudioweb.com'
    $mail->SetLanguage("it""language/phpmailer.lang-it.php"); 
    $mail->AddAddress("info@mdstudioweb.com""nome"); 
    //$mail->AddAddress("ellen@example.com"); // name is optional 
    $mail->AddReplyTo("$email""Ciao $nome $cognome /n
    Hai richiesto una prova gratuita per l'attività 
    $attivita "); 

    $mail->WordWrap 50;  // set word wrap to 50 characters 
    //$mail->AddAttachment("/var/tmp/file.tar.gz");  / add attachments 
    //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");  // optional name 
    $mail->IsHTML(true);// set email format to HTML 

    $mail->Subject "Here is the subject"
    $mail->Body    "This is the HTML message body [b]in вакпрнолгнкг5глгоьктртунл![/b]"
    $mail->AltBody "This is the body in plain text for non-HTML mail clients"

    if(!
    $mail->Send()) 

       echo 
    "Message could not be sent. 

    "

       echo 
    "Mailer Error: " $mail->ErrorInfo
       exit; 
    }

    mysql_free_result($Rs_mail);
    ?>
    però ne mi invia l'email nè mi risponde automaticamente qualcuno può aiutarmi

  2. #2
    no, non c'è nessuno che può....

  3. #3
    metti delle echo nello script per vedere se ti si blocca da qualche parte, se non manda la mail sono giusti i parametri? ad esempio vedo che non hai impostato nè host nè username nè password...
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  4. #4
    ho questo errore:

    Could not instantiate mail function. Message could not be sent.

    Mailer Error: Could not instantiate mail function.

  5. #5
    fai una pagina nuova e mettici solo questo codice in tutta la pagina:

    Codice PHP:
    <?php
    error_reporting
    (E_ALL);
    mail("YourEmailHere@domain.com""Test Subject""Test Message");
    ?>
    e vedi un pò se dà qualche errore
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  6. #6
    ok ora mi spedisce l'email ma non invia la risposta automatica all'indirizzo che il cliente inserisce ne form

  7. #7
    ok, mail funziona...allora hai sbagliato la configurazione di phpmailer. com'è il pezzo di codice che usa phpmailer? da documentazione, per inviare una email usando MAIL il codice dovrebbe essere del tipo:
    Codice PHP:
    <?php

    require_once('../class.phpmailer.php');

    $mail             = new PHPMailer(); // defaults to using php "mail()"

    $body             file_get_contents('contents.html');
    $body             eregi_replace("[\]",'',$body);

    $mail->AddReplyTo("name@yourdomain.com","First Last");

    $mail->SetFrom('name@yourdomain.com''First Last');

    $mail->AddReplyTo("name@yourdomain.com","First Last");

    $address "whoto@otherdomain.com";
    $mail->AddAddress($address"John Doe");

    $mail->Subject    "PHPMailer Test Subject via mail(), basic";

    $mail->AltBody    "To view the message, please use an HTML compatible email viewer!"// optional, comment out and test

    $mail->MsgHTML($body);

    $mail->AddAttachment("images/phpmailer.gif");      // attachment
    $mail->AddAttachment("images/phpmailer_mini.gif"); // attachment

    if(!$mail->Send()) {
      echo 
    "Mailer Error: " $mail->ErrorInfo;
    } else {
      echo 
    "Message sent!";
    }

    ?>
    magari te, con questo pezzo di codice:
    Codice PHP:
      // set mailer to use SMTP  
    $mail->Host "";  // specify main and backup server  
    $mail->Username "";  // SMTP username  
    $mail->Password ""// SMTP password 
    setti PER ERRORE phpmailer per usare un smtp server e quindi lui non riesce ad inviare la mail



    per il discorso "non invia la risposta automatica all'indirizzo che il cliente inserisce ne form" non ho capito che intendi...cmq inizierei da un problema per volta
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  8. #8
    no questi li ho eliminati ora le invio tramite email

    la risposta automatica sarebbe: l'utente riempie un piccolo form, con nome, cognome, telefono, email, e attività, poi invia. a me arriva la sua richiesta di una prova gratis, e a lui in automatico arriva un email del tipo hai richiesto una prova gratuita bla bla stampa questa mail e consegnala alla palestra scelta


    Codice PHP:
     // set mailer to use SMTP   $mail->Host = "";  // specify main and backup server   $mail->Username = "";  // SMTP username   $mail->Password = ""; // SMTP password 

  9. #9
    è la risposta automati il mio problema più grande per favore aiutami è per domani.....

  10. #10
    Cioè tu vuoi che dopo che l'utente compila una mail con questo form contatti, se tutto va a buon fine, che gli venga inviata una mail di ringraziamento?

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 © 2024 vBulletin Solutions, Inc. All rights reserved.