Does anyone know if you can configure the php mail () command to use only the SMTP server and not the local sendmail? We are having trouble marking emails as spam.
Our server runs RedHat 5 Enterprise.
I am aware of various PHP libraries that act as the SMTP client, but I would prefer to configure PHP so that mail () uses the SMTP server directly.
According to this manual page , this is only possible for Windows.
Check out these links:
Link 1
Link 2
Link 3
Example:
: , SMTP- mail().
<?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>
, , Linux/Unix "sendmail". , - SMTP-, , . SMTP Windows - , "sendmail" .
sendmail , SMTP. ssmtp ( avialable )
sendmail, ! , PHP.
PHP SMTP, !
SMTP , PEAR Mail. Net_SMTP SMTP-. . . , .
If you are looking for a replacement for an old function mail(), but which is sent via SMTP instead of PHP by default, you need to write a translator function that sets all the parameters in the correct order and the like. Here is an example of such a script - obviously, you have to change it to match the required parameters: http://tltech.com/info/php-mail-via-smtp/
mail()
Source: https://habr.com/ru/post/1724373/More articles:How to create a lookup table by type to implement multiple submission in C ++? - c ++How to save System.Windows.Controls.Image to a local drive - c #Как включить элемент для рисования за пределами его контейнера? - .netInversion of control or dependency injection - anyone who does this in C? - cIE conditional comments slow down page loading? - htmlSet ItemsSource ComboBox to an array of integers? - arraysЕсть ли запланированная версия StyleCop для VS 2010? - visual-studioОпределить, будет ли решение компилироваться с использованием MSBuild и PSake - powershellhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1724377/which-excel-interop-objects-to-clean-up-myself-and-which-to-clean-up-by-gccollect&usg=ALkJrhhbtEK2LBxB_5aiXUiXPWI6IDx9kgHow to print a complete template argument at compile time in C ++ - c ++All Articles