With php mail() I can write
mail(\'to@example.com\',\'subject!\',\'body\',\'From: from@example.com\',\'-f from@example.com\');
But how can
What worked for me (obscurely) using
$mail->SetFrom('name@yourdomain.com', 'Rupert Bear');
was to use localhost rather than directly access the smtp server e.g.
$email->Host='localhost'; // SMTP server this way you get from name (don't know why)
Now mails arrive in Outlook from 'Rupert Bear' [name@yourdomain.com]