You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 lines
444 B

from __future__ import absolute_import
import datetime
import os
from django.core.mail.backends import filebased
class EmailBackend(filebased.EmailBackend):
def _get_filename(self):
if self._fname is None:
timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
fname = "%s-%s.eml" % (timestamp, abs(id(self)))
self._fname = os.path.join(self.file_path, fname)
return self._fname