MyBB Community Forums
[How To?] email php function add date - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] email php function add date (/thread-217632.html)



email php function add date - flexen - 05-18-2018

hey,
mybb is sending emails through php (dockerrized server setup, not mine and a little too complicated 4 me 2 understand) and inserts the from field trough additional header options for phpmail in the mybb admin panel. this works good and is needet to show any from content at all:

$headers = "From: [email protected]\r\n"

is working flawlessly!

still its not sending the date. and this i cant get to work.

my current try is:

$headers = "Date: ". date("r") ."\r\n". "From: [email protected]\r\n"

but its not working out. where do i go wrong ? i really suck at coding, so i dont know when to , ; space . or whatever between arguments, etc.

i followed this hint at the botttom:
https://stackoverflow.com/questions/20686369/rfc2822-non-compliance-something-about-date-or-from-in-php-header

please help me...