0

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

$smtp = Mail::factory('smtp', array(
            'host' => 'ssl://smtp.gmail.com',
            'port' => '465',
            'auth' => true,
            'username' => 'your@gmail.com', //your gmail account
            'password' => 'snip' // your password
    ));

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.

Alexander Nikolov
  • 1,601
  • 4
  • 23
  • 43

1 Answers1

0

The PHP manual says you can set everything except the path to the sendmail binary in your directory-local .htaccess files. Your sample code appears to use the PEAR::Mail extension, which may not be available on your system.

Darwin von Corax
  • 5,026
  • 3
  • 15
  • 26