Encoding

SMTP Authentication

Zend_Mail supports the use of SMTP authentication, which can be enabled be passing the 'auth' parameter to the configuration array in the Zend_Mail_Transport_Smtp constructor. The available built-in authentication methods are PLAIN, LOGIN and CRAM-MD5 which all expect a 'username' and 'password' value in the configuration array.

Example #1 Enabling authentication within Zend_Mail_Transport_Smtp

  1. span style="color: #ff0000;">'auth' => 'login',
  2.                 'username' => 'myusername',
  3.                 'password' => 'password''mail.server.com''This is the text of the mail.''[email protected]', 'Some Sender''[email protected]', 'Some Recipient''TestSubject'

Note: Authentication types
The authentication type is case-insensitive but has no punctuation. E.g. to use CRAM-MD5 you would pass 'auth' => 'crammd5' in the Zend_Mail_Transport_Smtp constructor.


Encoding