This project is archived and is in readonly mode.

#3113 ✓stale
Joel Chippindale

ActionMailer only works correctly with sent_on set in in the local time zone

Reported by Joel Chippindale | August 28th, 2009 @ 10:42 AM

When you set the sent_on time on a mail to a time that is not in the local time zone the date in the TMail that is created.

This is because TMail assumes times are in the local time zone.

For example assuming your local time zone is PDT. Setting the sent_on time to Time.local(2004, 12, 12, 1), will give the correct date header "Sun, 12 Dec 2004 01:00:00 -0800". However setting the sent_on time to Time.local(2004, 12, 12, 1).utc, will incorrectly set the date header "Sun, 12 Dec 2004 09:00:00 -0800".

The attached patch fixes this by ensuring the ActionMailer converts times to the local time zone before passing to TMail.

This is a problem in both 2-3-stable and master and the patch should apply cleanly to both.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages