Controlling the MIME Boundary

Additional Headers

Arbitrary mail headers can be set by using the addHeader() method. It requires two parameters containing the name and the value of the header field. A third optional parameter determines if the header should have only one or multiple values:

Example #1 Adding E-Mail Message Headers

  1. $mail = new Zend_Mail();
  2. $mail->addHeader('X-MailGenerator', 'MyCoolApplication');
  3. $mail->addHeader('X-greetingsTo', 'Mom', true); // multiple values
  4. $mail->addHeader('X-greetingsTo', 'Dad', true);

To set the Reply-To: header there exists the function setReplyTo($email, $name=null), because it requires additional special escaping of the different parts (email and name).


Controlling the MIME Boundary