cmdline.append(to_addr)
mailer = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess
    .PIPE)
dialog = """From: %s
To: %s
Subject: %s

%s
.
""" % (from_addr, to_addr,
    subject, body)
return mailer.communicate(dialog)
Django sending email