Hello everyone, I have a function:

public static function sendEmail($to, $theme, $body){ $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: Техническая поддержка <support@test.ru>\r\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n"; mail($to, $theme, $body, $headers); } 

And when I send to the column from whom, always the name of the hosting (for example: lastch test_pr1_am hb@astral.beget.ru), and the sign I indicated in the header is not substituted, tell me where is my error?

    1 answer 1

    Read it but take a closer look!

    If you read very lazy here:

     public static function sendEmail($to, $theme, $body){ $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Техническая поддержка <support@test.ru>\r\n"; mail($to, $theme, $body, $headers); } 
    • Thanks for the answer, but nothing has changed (based on your example), and I read the documentation, with its help I wrote it. - Angus123
    • then we change tactics, run your script on another server on which exactly everything is plowing ... And if everything works, then to the Hoster or to the server settings ... - naguwal
    • Either run the mail method from the above documentation on your server, and if nothing works, then this is a Server ... - naguwal