
 Originariamente inviata da 
lucavalentino
					 
				 
				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