

from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.mail import send_mail


class Command(BaseCommand):
    """send mail test
    """

    def handle(self, *args, **options):
        send_mail('Testing mail', 'Here is the message.',
                  settings.DEFAULT_FROM_EMAIL, args)


from datetime import datetime

from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.mail import send_mail


class Command(BaseCommand):
    """send mail test
    """

   
    def message(self, message):
        self.stdout.write("%s\n" % message.encode("ascii", "replace"))

    def handle(self, *args, **options):
        now = datetime.now()
        body="""
Hi, this is the testing message

send on %s
""" % str(now)

        self.message(body)

        send_mail('Testing mail - %s' % str(now), body,
                  settings.DEFAULT_FROM_EMAIL, args)

Change subject to every mail to was sent
Change subject to every mail to was sent

  
+ from datetime import datetime
  
  from django.conf import settings
  from django.core.management.base import BaseCommand
  from django.core.mail import send_mail
  
  
  class Command(BaseCommand):
      """send mail test
      """
  
+    
+     def message(self, message):
+         self.stdout.write("%s\n" % message.encode("ascii", "replace"))
+ 
      def handle(self, *args, **options):
-         send_mail('Testing mail', 'Here is the message.',
+         now = datetime.now()
+         body="""
+ Hi, this is the testing message
+ 
+ send on %s
+ """ % str(now)
+ 
+         self.message(body)
+ 
+         send_mail('Testing mail - %s' % str(now), body,
                    settings.DEFAULT_FROM_EMAIL, args)
  
Change subject to every mail to was sent
## Code Before:


from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.mail import send_mail


class Command(BaseCommand):
    """send mail test
    """

    def handle(self, *args, **options):
        send_mail('Testing mail', 'Here is the message.',
                  settings.DEFAULT_FROM_EMAIL, args)

## Instruction:
Change subject to every mail to was sent
## Code After:

from datetime import datetime

from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.mail import send_mail


class Command(BaseCommand):
    """send mail test
    """

   
    def message(self, message):
        self.stdout.write("%s\n" % message.encode("ascii", "replace"))

    def handle(self, *args, **options):
        now = datetime.now()
        body="""
Hi, this is the testing message

send on %s
""" % str(now)

        self.message(body)

        send_mail('Testing mail - %s' % str(now), body,
                  settings.DEFAULT_FROM_EMAIL, args)
