Visualizzazione dei risultati da 1 a 5 su 5

Discussione: phpmailer register.it

  1. #1

    phpmailer register.it

    Sto eseguendo passando il mio sito sull'hosting register.it.

    Sto cercando di creare tramite phpmailer e office365di l'invio dell'email, ma trovo difficoltà

    codice:
    SMTP -> FROM SERVER:220 DB5PR01CA0058.outlook.office365.com Microsoft  ESMTP MAIL Service ready at Wed, 13 Jan 2016 07:52:07 +0000  
    SMTP -> FROM SERVER: 250-DB5PR01CA0058.outlook.office365.com Hello [185.2.4.24] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250 CHUNKING  
    SMTP -> ERROR: AUTH not accepted from server: 504 5.7.4 Unrecognized authentication type  
    SMTP -> FROM SERVER:250 2.0.0 Resetting  
    SMTP -> FROM SERVER:530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM  
    SMTP -> ERROR: MAIL not accepted from server: 530 5.7.57 SMTP;  Client was not authenticated to send anonymous mail during MAIL FROM  
    The following From address failed: root@localhost : MAIL not  accepted from server,530,5.7.57 SMTP; Client was not authenticated to  send anonymous mail during MAIL FROM SMTP server error: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM 
      Si è verificato un errore nell'invio della mail

    File PHPMailer/dati_phpmailer.php

    Codice PHP:
    $mail->IsSMTP(); // abilitiamo l"SMTP
      
    $mail->SMTPDebug 2;  
      
    $mail->SMTPAuth true;
      
    $mail->SMTPSecure 'TLS';
      
    $mail->Host 'smtp.office365.com'// ecco il server smtp di office365
      
    $mail->Port 587// la porta che dobbiamo utilizzare
      
    $mail->Username 'email@dominio.it'//email del nostro account office365
      
    $mail->Password 'dominio'//password del nostro account office365
      
    $mail->IsHTML(true); 

    [PHP]$messaggio = '<html><head><meta http-equiv=\'Content-Type\' content=\'text/html;
    ...........
    charset=utf-8\'></head><body>';
    $messaggio .= $body;
    $messaggio .='</body>';
    $mail = new PHPMailer(); // creiamo l"oggetto
    require_once 'include/PHPMailer/dati_phpmailer.php';
    $mail->FromName = $_POST['nome'];
    $mail->AddAddress($email_to);
    $mail->IsHTML(true);
    $mail->AddReplyTo($from);
    $mail->Subject = $subject;
    $mail->Body = $messaggio;
    $mail->AltBody = $AltBodys;
    //$mail->SmtpClose();
    if(!$mail->Send()){
    echo "Si è verificato un errore nell'invio della mail";

    }else{
    header('location: invia_ok.php');
    }

    Il fatto che il dominio su register.it sia diverso da quello con cui invio l'email potrebbe incidere??

    Aiuto

  2. #2
    Moderatore di Javascript L'avatar di ciro78
    Registrato dal
    Sep 2000
    residenza
    Napoli
    Messaggi
    8,506
    Quote Originariamente inviata da lucavalentino Visualizza il messaggio
    Sto eseguendo passando il mio sito sull'hosting register.it.

    Sto cercando di creare tramite phpmailer e office365di l'invio dell'email, ma trovo difficoltà

    codice:
    SMTP -> FROM SERVER:220 DB5PR01CA0058.outlook.office365.com Microsoft  ESMTP MAIL Service ready at Wed, 13 Jan 2016 07:52:07 +0000  
    SMTP -> FROM SERVER: 250-DB5PR01CA0058.outlook.office365.com Hello [185.2.4.24] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250 CHUNKING  
    SMTP -> ERROR: AUTH not accepted from server: 504 5.7.4 Unrecognized authentication type  
    SMTP -> FROM SERVER:250 2.0.0 Resetting  
    SMTP -> FROM SERVER:530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM  
    SMTP -> ERROR: MAIL not accepted from server: 530 5.7.57 SMTP;  Client was not authenticated to send anonymous mail during MAIL FROM  
    The following From address failed: root@localhost : MAIL not  accepted from server,530,5.7.57 SMTP; Client was not authenticated to  send anonymous mail during MAIL FROM SMTP server error: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM 
      Si è verificato un errore nell'invio della mail

    File PHPMailer/dati_phpmailer.php

    Codice PHP:
    $mail->IsSMTP(); // abilitiamo l"SMTP
      
    $mail->SMTPDebug 2;  
      
    $mail->SMTPAuth true;
      
    $mail->SMTPSecure 'TLS';
      
    $mail->Host 'smtp.office365.com'// ecco il server smtp di office365
      
    $mail->Port 587// la porta che dobbiamo utilizzare
      
    $mail->Username 'email@dominio.it'//email del nostro account office365
      
    $mail->Password 'dominio'//password del nostro account office365
      
    $mail->IsHTML(true); 

    [PHP]$messaggio = '<html><head><meta http-equiv=\'Content-Type\' content=\'text/html;
    ...........
    charset=utf-8\'></head><body>';
    $messaggio .= $body;
    $messaggio .='</body>';
    $mail = new PHPMailer(); // creiamo l"oggetto
    require_once 'include/PHPMailer/dati_phpmailer.php';
    $mail->FromName = $_POST['nome'];
    $mail->AddAddress($email_to);
    $mail->IsHTML(true);
    $mail->AddReplyTo($from);
    $mail->Subject = $subject;
    $mail->Body = $messaggio;
    $mail->AltBody = $AltBodys;
    //$mail->SmtpClose();
    if(!$mail->Send()){
    echo "Si è verificato un errore nell'invio della mail";

    }else{
    header('location: invia_ok.php');
    }

    Il fatto che il dominio su register.it sia diverso da quello con cui invio l'email potrebbe incidere??

    Aiuto

    guarda

    codice:
    The following From address failed: root@localhost : MAIL not  accepted from server,530,5.7.57 SMTP; Client was not authenticated to  send anonymous mail during MAIL FROM SMTP server error: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM 
      Si è verificato un errore nell'invio della mail
    mi sa che devi settare la proprietà from

    http://phpmailer.worxware.com/index.php?pg=properties
    Ciro Marotta - Programmatore JAVA - PHP
    Preferisco un fallimento alle mie condizioni che un successo alle condizioni altrui.


  3. #3
    Quote Originariamente inviata da ciro78 Visualizza il messaggio
    guarda

    mi sa che devi settare la proprietà from
    Ho inserito la proprietà from

    Codice PHP:
    ....
    ......
       
    $mail = new PHPMailer();  // creiamo l"oggetto
        
    require_once 'include/PHPMailer/dati_phpmailer.php';
        
    $mail->SetFrom(email@tiscali.it $_POST['nome']); 
    ....
    ...... 

    Ora ricevo questo errore
    codice:
    SMTP -> ERROR: Failed to connect to server: php_network_getaddresses:  getaddrinfo failed: Temporary failure in name resolution (0) 
    The following From address failed: email@tiscali.it : Called Mail() without being connected

  4. #4
    Moderatore di Javascript L'avatar di ciro78
    Registrato dal
    Sep 2000
    residenza
    Napoli
    Messaggi
    8,506
    Quote Originariamente inviata da lucavalentino Visualizza il messaggio
    Ho inserito la proprietà from

    Codice PHP:
    ....
    ......
       
    $mail = new PHPMailer();  // creiamo l"oggetto
        
    require_once 'include/PHPMailer/dati_phpmailer.php';
        
    $mail->SetFrom(email@tiscali.it $_POST['nome']); 
    ....
    ...... 

    Ora ricevo questo errore
    codice:
    SMTP -> ERROR: Failed to connect to server: php_network_getaddresses:  getaddrinfo failed: Temporary failure in name resolution (0) 
    The following From address failed: email@tiscali.it : Called Mail() without being connected
    Sembrerebbe che tu non sia collegato al server SMTP. Prova a mettere l'indirizzo ip del server invece del dominio.
    Ciro Marotta - Programmatore JAVA - PHP
    Preferisco un fallimento alle mie condizioni che un successo alle condizioni altrui.


  5. #5
    Quote Originariamente inviata da ciro78 Visualizza il messaggio
    Sembrerebbe che tu non sia collegato al server SMTP. Prova a mettere l'indirizzo ip del server invece del dominio.
    Ho inserito ip del dominio ed eliminato l'autenticazione SMTP e quindi usato la prta 25 e tutto funziona.

    Una curiosità:
    è meglio usare l'smtp autenticato oppure?

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.