{"id":242,"date":"2016-12-12T21:34:58","date_gmt":"2016-12-12T19:34:58","guid":{"rendered":"http:\/\/itsimple.info\/?p=242"},"modified":"2016-12-12T21:34:58","modified_gmt":"2016-12-12T19:34:58","slug":"check-if-php-can-send-mail-on-linux","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=242","title":{"rendered":"check if php can send mail on linux"},"content":{"rendered":"<h4 id=\"first-check-if-php-scripts-can-send-emails\">check if PHP-scripts can send emails: from console or putty session to the server<\/h4>\n<pre><code class=\"no-highlight\">php -a\r\nmail ('you@example.com', \"Test Postfix\", \"Test mail from postfix\");\r\nexit ();<\/code><\/pre>\n<p>Note: if after running\u00a0<code>php -a<\/code>, you get\u00a0<code>\"Interactive mode enabled\"<\/code>\u00a0message but no\u00a0<code>php&gt;<\/code>\u00a0prompt, then your PHP is not compiled with readline support. If its working nice, you will get only\u00a0<code>\"Interactive mode\"<\/code>\u00a0message with\u00a0<code>php&gt;<\/code>\u00a0prompt.<\/p>\n<p>You can still run test though. Just create a\u00a0<code>testmail.php<\/code>\u00a0with following lines of codes:<\/p>\n<pre><code class=\"no-highlight\">&lt;?php\r\n    mail ('you@example.com', \"Test Postfix\", \"Test mail from postfix\");\r\n?&gt;<\/code><\/pre>\n<p>and run it on your server with\u00a0<code>php -f testmail.php<\/code>\u00a0command. If you can\u2019t see any email form PHP, then that means its PHP\u2019s fault.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>check if PHP-scripts can send emails: from console or putty session to the server php -a mail (&#8216;you@example.com&#8217;, &#8220;Test Postfix&#8221;, &#8220;Test mail from postfix&#8221;); exit (); Note: if after running\u00a0php -a, you get\u00a0&#8220;Interactive mode enabled&#8221;\u00a0message but no\u00a0php&gt;\u00a0prompt, then your PHP is not compiled with readline support. If its working nice, you will get only\u00a0&#8220;Interactive mode&#8221;\u00a0message [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,13],"tags":[],"class_list":["post-242","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}