A
A
Arkady Baganin2018-12-14 14:24:23
PHP
Arkady Baganin, 2018-12-14 14:24:23

How to change php mail() headers?

Good day!
How can I remove this from the service header?

Received: from s35.h.mchost.ru ([178.208.83.42]:33404)

Here is the code itself:
if(count($_POST) > 1){
  $from = strval($_POST['from']);
  $to = strval($_POST['to']);
  $subject = strval($_POST['subject']);
  $who = strval($_POST['who']);
  $toes = explode(';', $to);
  $t1 = $toes[0];
  $mess = $_POST['mess'];
  $headers = "MIME-Version: 1.0" . "\r\n";
  $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  $headers .= "From: $who <$from>";
  if(count($toes) > 1){
    $to = $toes[0];
    for($i = 1; $i < count($toes); $i++){
      $whe = strval($toes[$i]);
      $to .= ",$whe";
    }
  }
   mail($to, $subject, $mess, $headers, "-fno-$from");
  echo '<script>alert("Sent letter!");</script>';
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Satisfied IT, 2018-12-14
@ark_yt

If used, postfixthen you can use this method:
https://major.io/2013/04/14/remove-sensitive-infor...

B
Boris Syomov, 2018-12-14
@kotomyava

This header is not added on your side, but by the intermediate servers and the receiving server. Headers can be more than one if there are relays, these headers can be used to restore the path of the letter.
On your side, you cannot remove it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question