Pagina 1 di 5 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 48
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802

    istallare la classe class.phpmailer.php

    salve ragazzi buonasera volevo domandarvi ho deciso di usare una classe class.phpmailer.php adesso secondo voi cosa potrebbe essere l errore ho provato ad usare un esempio che esce nella classe
    Codice PHP:
    if($inserisco_dati_di_registrazione){
    $verific_mess_email_registrazion mysql_query("select * from email_status    where register_user = '1'");
    $result_mess_email_registrazion mysql_num_rows($verific_mess_email_registrazion);
    if(
    $result_mess_email_registrazion == 1){


    $user_dati " SELECT * FROM utenti
    WHERE `email` ='
    $email'";
    $result mysql_query($user_dati);
    // controllo l'esito
    if (!$result) {
        die(
    "Errore nella query $user_dati: " mysql_error());
    }
    while(
    $row mysql_fetch_array($result))
    {
    $nome $row['nome'];
    $cognome $row['cognome'];
    $telefono $row['telefono'];
    $email $row['email'];
    $dat_iscrizione $row['date'];
    $date_ultimemod_user $row['date_ultima_mod'];
    $numero_a_caso $row['caso'];
    }

    include_once(
    '../includes/class/class.phpmailer.php');

    $mail    = new PHPMailer();

    $body    $mail->getFile('contents.html');

    $body    eregi_replace("[\]",'',$body);

    $mail->From     "$email";
    $mail->FromName "$nome";

    $mail->Subject "Registration Pending for $nome Support Desk";

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

    $mail->MsgHTML($body);

    $mail->AddAddress("support@marikwebnet.com""John Doe");

    if(!
    $mail->Send()) {
      echo 
    'Failed to send mail';
    } else {
      echo 
    'Mail sent';
    }





    un altra cosa i percorsi della lingua doe si devono settare?
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    cosi mi da il seguente errore
    warning: fopen(contents.html) [function fopen] failed to open stream no souch file or directory
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  3. #3
    manca contents.html , che file è?

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    non saprei l ho preso dall esempio della classe un altra cosa i files della lingua da dove devono essere settati?
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    ma nella classe deve essere settata qual cosa?
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  6. #6
    Utente di HTML.it L'avatar di Gab-81
    Registrato dal
    Nov 2005
    Messaggi
    558
    Ciao, io l'ho usata per una mailing list con questo codice:

    Codice PHP:
    $mail = new PHPMailer();    // Create a PHPMailer object
    $mail->IsSMTP();    // set mailer to use SMTP
    $mail->Host SMTP_HOST;    // specify main and backup server
    $mail->Port SMTP_PORT;
    $mail->SMTPAuth SMTP_AUTH;    // turn on SMTP authentication
    $mail->Username SMTP_USERNAME;    // SMTP username
    $mail->Password SMTP_PASSWORD;    // SMTP password
    $mail->From MAIL_FROM;    // Sender    
    $mail->FromName MAIL_FROM_NAME;    // Sender name
    $mail->SetLanguage('it',PHP_MAILER_DIR.'language/');
    /* Get all subscribers */
    $subscribers db_get_all_subscribers();
    foreach(
    $subscribers as $subscriber) {
        
    $mail->AddBcc($subscriber['email'], $subscriber['name']);
    }
    $mail->WordWrap 50;    // set word wrap
    $mail->IsHTML(true);                                  // set email format to HTML
    $mail->Subject $title;
    $mail->Body    '<h1>'.$title.'</h1>'.$content;
    if(!
    $mail->Send()) {
            echo 
    '<script type="text/javascript" src="'.JS_ADMIN_DIR.'mailing-list/error.js"></script>';
    exit;
    }
    // Save the mail into db
    db_store_email($title$content$today);
    echo 
    '<script type="text/javascript" src="'.JS_ADMIN_DIR.'mailing-list/success.js"></script>'
    Praticamente tutti i parametri sono presi da file di configurazione, però fila tutto liscio...Ah, uso autenticazione SMTP per l'invio. per disabilitarla basta mettere $mail->SMTPAuth = false...
    SMTP_AUTH è globale in file di configurazione...

  7. #7
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    ciao e grazie e se volessi dare da un comanda quale classe usare la mail o la smtp?
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  8. #8
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    scusa a che serve questa funzione
    Codice PHP:
    /* Get all subscribers */ 
    $subscribers db_get_all_subscribers(); 
    foreach(
    $subscribers as $subscriber) { 
        
    $mail->AddBcc($subscriber['email'], $subscriber['name']); 

    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  9. #9
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    mi da un errore sarebbe che non mi fa inviare l email
    Codice PHP:
    $mail = new PHPMailer();    // Create a PHPMailer object 
    $mail->IsSMTP();    // set mailer to use SMTP 
    $mail->Host SMTP_HOST;    // specify main and backup server 
    $mail->Port SMTP_PORT
    $mail->SMTPAuth false;    // turn on SMTP authentication 
    //$mail->SMTPAuth = SMTP_AUTH;    // turn on SMTP authentication 

    $mail->Username SMTP_USERNAME;    // SMTP username 
    $mail->Password SMTP_PASSWORD;    // SMTP password 
    $mail->From      "$email";    // Sender     
    $mail->FromName  "$email";     // Sender name 
    //$mail->SetLanguage('it',PHP_MAILER_DIR.'language/'); 
    $mail->WordWrap 50;    // set word wrap 
    $mail->IsHTML(true);                                  // set email format to HTML 
    $mail->Subject "Registration Pending for $nome Support Desk"
    $mail->Body    "Registration Pending for $nome Support Desk"
    if(!
    $mail->Send()) { 
        echo 
    "Si è verificato un errore nell'invio della mail";
        exit; 

    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  10. #10
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,802
    ragazzi ho fatto cosi e spedisc l email, soltanto che non mi vede l email avete presente outluk espress un po sopra del messaggio a meta, dove dice da: a: oggetto quella dove c e a : mi da la veriabbile $email io ho fatto cosi
    Codice PHP:
    $mail = new PHPMailer();

    $mail->IsSMTP();                                      // set mailer to use SMTP
    $mail->Host "";  // specify main and backup server
    $mail->SMTPAuth false;     // turn on SMTP authentication
    $mail->Username "";  // SMTP username
    $mail->Password ""// SMTP password

    $mail->From     "$email";
    $mail->FromName "$email_register";
    $mail->SetLanguage("it""../includes/language/");
    $mail->AddAddress("$email""$nome");
    //$mail->AddAddress("ellen@example.com");                  // name is optional
    //$mail->AddReplyTo("$email", "Information");

    $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;

    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

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.