'Which PHPMailer prop controls the sender email in the email header?

I'm getting an error from jQuery with a 404 to my mail.php (I checked the path and it seems correct)

<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

require("../includes/libraries/phpmailer/PHPMailer-master/src/Exception.php");
require("../includes/libraries/phpmailer/PHPMailer-master/src/PHPMailer.php");
require("../includes/libraries/phpmailer/PHPMailer-master/src/SMTP.php");

$server_email = '[email protected]';
$pass = '123456';

$full_name  = $_POST['full_name'];
$email      = $_POST['email'];


$mail = new PHPMailer();
$mail->IsSMTP();
$mail->IsHTML(true); 
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true; 
$mail->SMTPSecure = 'tls'; 
$mail->Host = 'smtp-mail.outlook.com';
$mail->Port = 587;
$mail->Username = $server_email;
$mail->Password = $pass; 


$mail->FromName = $full_name;   
$mail->From =  $email;  
$mail->setFrom($server_email, $full_name );
$mail->addAddress($server_email); 
$mail->addReplyTo($email); //email that it will be replied to

$mail->Subject = 'Subscription submitted by ' . $full_name . '.';
$mail->Body = "
  Name: $full_name<br><br> 
  Email: $email<br>
";

if(!$mail->send())
  {
    echo "Mailer Error: " . $mail->ErrorInfo;
  } else {
    echo "Message has been sent";
  }
?>

Right now, my email (the outlook one) comes up in the header of the email next to the Sender's Name. The addReplyTo actually does give me the gmail address to reply to, so that's great. But having my email show on the sender header is confusing. See the image below

enter image description here

Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source