Not a developer? Go to



The mail_filter callback is invoked just prior to Movable Type sending an email.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $params - a hash ref containing information about the email being sent.

The following are the keys of the parameter ($params) hash passed into the handler as input:

  • args - a reference to all of the arguments passed to MT::Mail->send
  • headers - a reference to an associative array containing all of the SMTP headers for the email.
  • body - the text of the email
  • transfer - the value of MailTransfer (sendmail or smtp)
  • id - the ID of the template in string form, effectively identifying the email type, used to generate this email (optional)

Return Value


Example Handler

sub handler {
    my ($cb, $params) = @_;
    $params->{headers}->{Content-Type} = "text/html";