I am trying to setfrom to be alias email. I created alias email in gmail. and i set it as default sender so if i send normal email from gmail it is working fine. but when i send email from phpmailer the receiving emails showing the original email and alias email. and my code working with port 465 and ssl. if iam butting it to port 587 and tls doing no thing(phpmailer) not working.
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.gmail.com';
$mail->SMTPDebug = 2;
$mail->Port = 465;
$mail->IsHTML();
$mail->Username = 'original email';
$mail->Password = 'app password';
$mail->SetFrom('alias email', '');
$mail->Subject = 'Massage from alias.';
$mail->Body = 'test';
$mail->addAddress('send to', 'ToEmail');
$mail->send();