xamppのローカルホストを介してphpmailerライブラリを使用してgmailアカウントにメッセージを送信できましたが、メッセージにはgmailアカウントが $mail->SetFrom に設定されている代わりに「rootユーザー」が表示されています この「rootユーザー」を削除して表示する方法適切な名前。
<?php
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true;
$mail->Mailer = "smtp";
$mail->SMTPSecure = "tls";
$mail->Username = "georgediamei1234@gmail.com";
$mail->Password = "password";
$mail->Host = 'ssl://smtp.gmail.com'; // SMTP server
$mail->Port = 465;
$mail->FromName ='georgediamei1234@gmail.com';
$mail->AddAddress("nowtonkhurai@gmail.com");
$mail->Subject = "";
$mail->Body = "Hello, <b>Is photo attached</b>!\n\n This message uses HTML entities!";
$mail->addStringAttachment("$string","08DsAlg.pdf", "base64","application/pdf");
if($mail->send()) {
echo "Email sent";
} else {
echo 'Not send '.$mail->ErrorInfo;
}
?>