PHP MAILER 関数に問題があります。メールの送信に GMAIL SMTP 認証を使用していますが、完全に機能していますが、「myid@domainname.com」のような「差出人」メールを設定したいのですが、正しく機能しません。
以下のコードを使用して「From」メールを設定しました
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.gmail.com"; // SMTP server
$mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "test@gmail.com"; // GMAIL username
$mail->Password = "test@123";
$mail->SetFrom("myid@domainname.com","Domian");
myid@domainname.com ではなく、デフォルトのメール test@gmail.com が表示されます
私を助けてください。
前もって感謝します!