PHP: mail () funkcja ze środowiskiem wykonawczym ini_set () dla SMTP i SMTP_PORT nie działa w systemie Linux

Użyłem kodu PHP do wysyłania wiadomości za pomocą hosta SMTP podanego poniżej:

        ini_set('SMTP','myserver');
ini_set('smtp_port',25);
$to = $email;
$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers  .= "From: NO-REPLY<[email protected]>" . "\r\n";
$subject = "Confirmation For Request";
$message = '<html>
                <body>
                    <p>Hi '.$firstname.' '.$lastname.'</p>
                    <p>
                        We recieved below details from you. Please use given Request/Ticket ID for future follow up:
                    </p>
                    <p>
                        Your Request/Ticket ID: <b>'.$ticketID.'</b>
                    </p>
                    <p>
                    Thanks,<br>
                    '.$team.' Team.
                    </p>
                </body>
            </html>';
mail( $to, $subject, $message, $headers ); 

Teraz, gdy wykonam kod w Windows Localhost .. Odbieram mail z powodzeniem, jeśli jednak nie zgadzam się z tym samym kodem w moim systemie Linux, nie otrzymuję anymaila, chociaż funkcja mail () zwraca prawdę również na maszynie linux. ...

Patrząc na phpinfo dla Windows Localhost i Linux Server, dla parametrów poczty znalazłem jedną różnicę,

W systemie Windows znalazłem sendmail_path == „No Value”, podczas gdy na serwerze linux mówi „usr / sbin / sendmail -t -i”

Czy ktoś może mi pomóc rozwiązać ten problem?

UWAGA: W systemie Windows jest to konfiguracja WAMP, podczas gdy Linux jest serwerem dedykowanym ...

questionAnswers(2)

yourAnswerToTheQuestion