Home › Forums › Quform WordPress › Add SMTP header
- This topic has 4 replies, 2 voices, and was last updated 7 years, 8 months ago by Ally.
- AuthorPosts
- August 31, 2016 at 3:10 pm #19781MartinFParticipant
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?
September 1, 2016 at 10:09 pm #19801AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 2, 2016 at 8:41 am #19803MartinFParticipantHi 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,
MartinSeptember 2, 2016 at 9:44 am #19804MartinFParticipantI 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. 🙂
September 2, 2016 at 8:37 pm #19809AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.