When I'm sending emails via well-known UA's (such as Outlook, Roundcube...) everything is fine
but
when I try to send programmatic email by using PHPMailer I got trouble in sent message headers:
Received: from www.domain.tld (hostname.domain.tld [127.0.0.1])
by hostname.domain.tld (Postfix) with ESMTP id C4D7232C14EB
for <me@somedomain.com>; Tue, 3 Feb 2015 16:23:17 +0100 (CET)
where www.domain.tld
is url of website where is my script located, hostname.domain.tld
is, obviously, server's FQDN.
Here is my code:
$mail = new PHPMailer;
$mail->SMTPDebug = false;
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->From = 'samplesender@sampledomain.tld';
$mail->FromName = 'Some sender name';
$mail->addAddress($emailadresa, $ime);
$mail->CharSet = 'UTF-8';
$mail->isHTML(true);
$mail->Subject = 'Email subject';
$mail->Body = $htmlBody;
$mail->XMailer = ' ';
I've also noticed from www.domain.tld
in headers which are not there when I send email via well-known UA's.
How to get rid of 127.0.0.1 headers when sending with PHPMailer?