back to phpList.org

Setting up custom email headers, is it possible?

Hello,

As the topic suggests is it possible to create custom email headers of the sort X-CustomHeaderName? My SMTP relay server allows us to have enhanced tracking and statistics capabilities through the use of custom headers.

Thanks!

You would need to write a plugin to provide the extra header by implementing the plugin messageHeaders() method.

  /**
   * messageHeaders
   *
   * return headers for the message to be added, as "key => val"
   *
   * @param object $mail
   * @return array (headeritem => headervalue)
   */
  function messageHeaders($mail) {
    return array();
  }

There is a somewhat lengthy guide to plugin development at https://resources.phplist.com/develop/plugins but you are mainly interested in the section on hooks, https://resources.phplist.com/develop/plugins#application_hooks

1 Like

Hello,
Somebody can help for create a plugin for add custom header based on attribute ?
I don’t really understand how to use that part.
I’m learning php and I need to change the retrun-path address and from adress for make them uniq.
Thx per advance.