Add SMTP header

Home Forums Quform WordPress Add SMTP header

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19781
    MartinF
    Participant

    Hi,

    I’m currently configuring this form to be used with a MailGun SMTP server,
    I’ve been told by them to add x-mailgun-native-send: true to the header of the emails being sent.

    Is there a place I can do this, or what file(s) do I need to edit to be able to do this?

    #19801
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #19803
    MartinF
    Participant

    Hi Ally,

    Thank you for the reply.

    I did what you asked me to do.. First I tried to edit the functions.php file, but got an error message when I tried to submit the form.. Then I created a plugin, and got the same error message.. This is from the error_log file:

    [02-Sep-2016 07:33:27 UTC] PHP Fatal error: Call to a member function Send() on a non-object in /home/user/public_html/wp-content/plugins/iphorm-form-builder/includes/common.php on line 835

    This is the contents of the plugin php file:

    <?php

    /*
    * Plugin Name: Quform MailGun Header
    * Description: Add MailGun Header to Quform
    * Version: 1.0
    */

    function my_custom_email_header($mailer)
    {
    $mailer->addCustomHeader(‘x-mailgun-native-send’, ‘true’);
    }
    add_action(‘iphorm_pre_send_notification_email’, ‘my_custom_email_header’);
    add_action(‘iphorm_pre_send_autoreply_email’, ‘my_custom_email_header’);

    ?>

    Is there something wrong with the code?

    Thank you again for the help.

    Best regards,
    Martin

    #19804
    MartinF
    Participant

    I figured out what was wrong, this is the code I ended up using:

    <?php

    /*
    * Plugin Name: Quform MailGun Header
    * Description: Add MailGun Header to Quform
    * Version: 1.0
    */

    function my_custom_email_header($mailer)
    {
    $mailer->addCustomHeader(‘x-mailgun-native-send: true’);
    return $mailer;
    }

    add_action(‘iphorm_pre_send_notification_email’, ‘my_custom_email_header’);
    add_action(‘iphorm_pre_send_autoreply_email’, ‘my_custom_email_header’);

    ?>

    Thank you for the help. 🙂

    #19809
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy