Search code examples
phpsmtpemail

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


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= ).


Solution

  • 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