How is phpmailer's FROM address changed? I expected the following to work, however, all emails sent use the the send from email address set by the first occurrence of SetFrom()
.
$mail = new myPHPMailer(true);
$mail->SMTPDebug=2;
$mail->Subject = "My Subject";
$mail->MsgHTML('My Message');
$mail->AddReplyTo('me@myworkcompany.com');
$mail->ClearAllRecipients();
$mail->SetFrom('me@myworkcompany.com');
$mail->AddAddress("someoneelse@otherdomain.com");
$mail->Send();
$mail->ClearAllRecipients();
$mail->SetFrom('default@mydomain.com'); //Does not update FROM address!
$mail->AddAddress("someoneelse@myworkcompany.com");
$mail->Send();
PS. Why I wish to do this? I have found that some companies set up their e-mail routers to deny all incoming external emails which have a sender email top level domain the same as their own.