title: How to send SMTP request and read response with php curl?
body: <p>I'm trying to send <code>smtp</code> request to my <code>smtp</code> server installed in <code>freebsd</code> and read the successful or fail response?
  This is my code : </p>
  
  <pre><code>$url = '192.168.1.227:25/';
      $user = 'admin';
      $pass = '123';
  
      $params = array(
          'User'      =&gt; $user,
          'passwor'   =&gt; $pass,
          'to'        =&gt; 'example1@example.com',
          'subject'   =&gt; 'test',
          'html'      =&gt; 'body',
          'text'      =&gt; 'text',
          'from'      =&gt; 'example2@example.com',
        );
  
  
      $session = curl_init($url);
      curl_setopt ($session, CURLOPT_POST, true);
      curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
      curl_setopt($session, CURLOPT_HEADER, 1);
      curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
      $response = curl_exec($session);
      $info = curl_getinfo($session);
      curl_close($session);
      echo $response;
      print_r($info);
  </code></pre>