php-smtp icon indicating copy to clipboard operation
php-smtp copied to clipboard

[Feature Request] Add custom headers

Open ncou opened this issue 8 years ago • 3 comments

Hi,

Is it possible to add a new feature to add custom headers ?

I think to add a custom header to check after the email send, the percent off "mail bounce" using this header to check via imap the returned mails.

ncou avatar Oct 21 '17 10:10 ncou

Can you show me some examples?

swt83 avatar Oct 23 '17 14:10 swt83

Here about the example : https://dyn.com/blog/what-are-x-headers-email-delivery-101-why-do-they-matter/

And here for the spec : http://www.faqs.org/rfcs/rfc822.html#b

PHPMailer has a method "addCustomHeaders()" here https://github.com/PHPMailer/PHPMailer/blob/10341cc3106916a218c4fc3394f674adf127d625/src/PHPMailer.php#L3638

Looks like the custom header should start with "X-".

ncou avatar Oct 23 '17 18:10 ncou

I don't have any objection, if you want to add this ability and submit a pull request.

swt83 avatar Oct 26 '17 13:10 swt83