This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Modify Email Header info


  1. epsd
    Member

    Using the latest version. I need to add a custom header into the email/email headers being sent out so that they are not picked up by the our spam filter... Any ideas where to do this at?

    Posted 11 years ago #
  2. epsd
    Member

    Just bumping this up. let me know if clarification is needed.

    Posted 11 years ago #
  3. yuniar

    What header you would like to add? MachForm uses SwiftMailer library and the email function is defined inside "includes/helper-functions.php" file.
    Particularly inside "mf_send_notification()" function.


    MachForm Founder

    Posted 11 years ago #
  4. epsd
    Member

    Basically, I want to add a custom header with a keyword it in so it can be IDed. So I would add something like:

    X-myID: MyCustomID

    Posted 11 years ago #
  5. yuniar

    You can try editing the "includes/helper-functions.php" file. Around line 1070 you should find this block of code:

    $s_message = Swift_Message::newInstance()
    			->setCharset('utf-8')
    			->setMaxLineLength(1000)
    			->setSubject($subject)
    			->setFrom(array($from_email => $from_name))
    			->setSender($from_email)
    			->setReturnPath($from_email)
    			->setTo($email_address)
    			->setBody($email_content, $email_content_type);

    below that block of code, add this code:

    $headers = $s_message->getHeaders();
    $headers->addIdHeader('Your-Header-Name', '123456.unqiue@example.org');

    that should add the custom header.


    MachForm Founder

    Posted 11 years ago #

RSS feed for this topic

Reply