D
D
Dima Barsukov2014-08-07 14:50:10
PHP
Dima Barsukov, 2014-08-07 14:50:10

How to remove [email protected] from email headers?

Sending an email through phpmailer using mail().
Letters go to the main mail services, but the headers glow a little

Return-Path: <[email protected]>
Received: from domain.ru (domain.ru. [x.x.x.x])
        by mx.google.com with ESMTPS id ...
        for <[email protected]>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Thu, 07 Aug 2014 04:18:05 -0700 (PDT)
Received-SPF: pass ...;
Authentication-Results: mx.google.com;
       spf=pass (...) [email protected];
       dkim=pass [email protected]
Received: from domain.ru (localhost [127.0.0.1])
  by domain.ru (8.14.5/8.14.5) with ESMTP id ...
  for <[email protected]>; Thu, 7 Aug 2014 18:18:03 +0700
Received: (from [email protected])
  by domain.ru (8.14.5/8.14.5/Submit) id ...;
  Thu, 7 Aug 2014 18:18:03 +0700

Especially the last header is Received: (from [email protected]) . I rummaged through the Internet, many people swear at it, but no solutions.
sendmail server, here is a snippet of its log
Aug 7 18:18:03 ... sendmail[26917]: ...: [email protected], size=5419, class=0, nrcpts=1, msgid= <513b9f8b0caf85b42f6c3382f5fe8cc4 @dev .domain.ru>, [email protected]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Litvinov, 2014-08-07
@Sander_Li

You can change the email for everyone in php.ini

sendmail_path = "/usr/sbin/sendmail -t -i -f [email protected]
But it's better not to do that.
I advise you to look at the mail() function doc .
In additional_parameters, it is enough to write an Example:-f [email protected]
mail('[email protected]', 'Subject', 'Body', 'From: [email protected]', '-f [email protected]');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question