SMTP Headers.AddHeader getting stripped out

Not sure if I should be chasing this down with my Web/Email host (I use their SMTP server to send messages) or if it’s my own issue.

mail.Headers.AddHeader("X-MyHeaderHere", "MyHeaderValueHere")

When I inspect the message as it’s being sent, it has the header as it’s send thru SMTPSecureSocket, but when the email is received the header isn’t there.

i guess the mail server software rebuild the mail.

The mail server software should add to the header but not removed header fields. The email software can change the email. Mail, for instance, does that.

Please check with CURL or the Chilkat plugin. With the latter I get the additional header fine:

Subject: Error Report
X-Mailer: Moth Software

1 Like

x- are not rfc conform and spammers can add fake data.

i found at google

X-header fields are usually preserved but ignored by messaging servers and clients that don’t use them and organizations may opt to disable the headers from their outbound emails.

1 Like

As it turns out, it’s the users desktop email client that is removing the header. @Beatrix_Willius thanks for your reply, it made me take a closer look at where the issue really resides. And @MarkusR thanks for jumping in on this too.

For posterity and anyone else who might stumble on this post, here’s the offending email client:

1 Like