php.ini & SMTP= - how do you pass username & password

Charles Faiga picture Charles Faiga · Sep 21, 2008 · Viewed 289.3k times · Source

My ISP account requires that I send a username & password for outbound SMTP mail.

How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (SMTP= ) and From: (sendmail_from= ).

Answer

daremon picture daremon · Sep 22, 2008

PHP mail() command does not support authentication. Your options:

  1. PHPMailer- Tutorial
  2. PEAR - Tutorial
  3. Custom functions - See various solutions in the notes section: http://php.net/manual/en/ref.mail.php