H. Ferrence
H. Ferrence

Reputation: 8116

What is the correct parameter setting for smtp auth

I have this script:

  // Define SMTP Parameters
  $params = array();
  $params['host']     = 'mail.mydomain.com';
  $params['port']     = '25';
  $params['auth']     = 'true';
  $params['username'] = '[email protected]'; // this needs to be a legitimate mail account on the server and not an alias
  $params['password'] = 'abcdef';

  // Create the mail object using the Mail::factory method
  include('Mail.php');
  $mail_object =& Mail::factory('smtp', $params);

params['auth'] does not seem to work when set to 'true' but it does seem to work when set to 'PLAIN'. Oddly, the doc only states $params["auth"] - Whether or not to use SMTP authentication. Default is FALSE. which makes it sound like you can use FALSE vs. 'PLAIN'

Upvotes: 0

Views: 874

Answers (1)

Gennadiy Litvinyuk
Gennadiy Litvinyuk

Reputation: 1607

The possible authentication methods are:

  • 'DIGEST-MD5'
  • 'CRAM-MD5'
  • 'LOGIN'
  • 'PLAIN'

or false for no authentication.

http://pear.github.io/Net_SMTP/#smtp-authentication

PS: You could have noticed, that pear/Mail package is used. By the way it is relative old with latest changes in 2010

Upvotes: 2

Related Questions