Support » Plugin: WP Mail SMTP by WPForms » List-Unsubscribe header has blank value with Mailgun

  • Resolved Vinny


    Hi, Great plugin. I currently have it connected to Mailgun via the API method and I ran into a weird issue.

    I’m trying to add the List-Unsubscribe header to messages my plugin is sending out and my test emails were reaching my gmail box with the value blank. e.g.:


    I checked the PHPMailer output and the header was correct. After opening a ticket to Mailgun to find out if the problem is on their end, I decided to try changing WP Mail SMTP to use the SMTP method against the Mailgun sandbox. This time the header arrived intact.

    Not sure if it’s a bug with WP Mail SMTP’s Mailgun API feature or if it’s a problem over at Mailgun. It’d be great to get to the bottom of this.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gregor Capuder


    Hi Vinny,

    I just tested this and the header is present in my sent email.

    I configured the Mailgun mailer and I added a custom header to a contact form:
    List-Unsubscribe: "test"

    In the original message of this email I can see the header just OK, together with other headers:

    X-Mailer: WPMailSMTP/Mailer/mailgun 2.7.0
    List-Unsubscribe: "test"

    What is the value of the header, that gets removed? Could you try to enclose it with quotation marks, like this List-Unsubscribe: "value goes here".

    Let me know how it goes.

    Take care!

    Thread Starter Vinny


    Hi Gregor,

    Thanks for getting back to me. All of the documentation I found says to place the value in <>. e.g

    List-Unsubscribe: <>

    I tried placing it either inside double quotes or with no quotes and no angle brackets and the value isn’t stripped out. The Mailgun API just doesn’t like the brackets, it seems.

    Now I just have to figure out why Gmail isn’t showing the Unsubscribe option like everyone says it should.


Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.