Forum Moderators: open

Message Too Old, No Replies

Custom variables in email header - possible?

Having JSON variables in email header to store data

         

tomda

7:48 am on Nov 2, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry if I post in the wrong forum, i couldn't find a thread about email.

I wanted to know if it is possible to have custom variables in email header, JSON formatted, and presumably under that Extra-Header or Extra-parameters.
I really struggle to find information about this.

csdude55

6:05 pm on Nov 3, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sure, just put the variable before the "Subject" line. Then you can view it in the source.

In Perl, I have this:

open(MAIL,"|$mailprog -t");
print MAIL "To: me@mysite.com\n";
print MAIL "From: example\@example\n";
print MAIL "Whatever: some data I want to send\n";
print MAIL "Subject: Test Email\n\n";

print MAIL "This is a test";
close(MAIL);