Hi,
I am trying send email through smtplib

import smtplib
import os
from libs import send_mail_status
send_mail_status('test', False, 'ABCD', os.getcwd())


libs.py has a function as below:
def send_status_mail(name, success, id, dir):
    #SERVER = "localhost"
    FROM = "localhost"
    TO = ["a...@nus.edu.sg"]
    SUBJECT = "test"
    body = "test"
    message = """\
    From: %s
    To: %s
    Subject: %s
    %s
    """ % (FROM, ", ".join(TO), SUBJECT, body)

But I receive an email as below: All the contents are in the email body:

From: localhost
    To: a...@nus.edu.sg
    Subject: test

    test

Why all the ocntents are written in the body where as email body should have 
just a string "test"
Kindly clarify. Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to