in reply to Re^3: send mail with STARTTLS
in thread send mail with STARTTLS

Are you sure that [func://localtime]() or giving "just the date" are things that will supply a well-formatted Date header?

You most likely want something like DateTime::Format::Mail. At least your value should look something like Sat, 29 Mar 2003 22:11:18 -0800.

Replies are listed 'Best First'.
Re^5: send mail with STARTTLS
by cavac (Prior) on Dec 16, 2025 at 09:28 UTC

    As a funny sidenote, depending on the Date library used, just make sure the weekday name calculation is correct. Many, many, many years ago i once ran into that exact problem. Sudenly, my mails started getting rejected by some server, leading me on a long bug hunt... until i found a leap year bug that messed up weekday names...

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
    Also check out my sisters artwork and my weekly webcomics
      [...]mails started getting rejected by some server [...] until i found a leap year bug that messed up weekday names [...]

      Now that's a cool bug. I never expected servers to actually validate weekdays. Checking for one of the seven weekday names at the right position, yes, of course. But not actually matching the name to the date. On the other hand, there might have been some lazy spammers that simply always sent "Monday" or something like that.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)