title: PHP - SMTP configuration without php.ini
body: <p>I am using mail() to send emails in my php application. Since I do not have access to my hosting server settings ( php.ini ), is it possible to configure the SMTP settings from my application ? So far I have found this approach</p>
  
  <pre><code>$smtp = Mail::factory('smtp', array(
              'host' =&gt; 'ssl://smtp.gmail.com',
              'port' =&gt; '465',
              'auth' =&gt; true,
              'username' =&gt; 'your@gmail.com', //your gmail account
              'password' =&gt; 'snip' // your password
      ));
  </code></pre>
  
  <p>but once I am not sure how to include this Mail class and second I need to do this everywhere I send mails in the app so seems not good for me. </p>