Hi all,

How can i add different Return-path and fromid in python.i have pasted the 
below code for preview


def sendMail(sub,fromid,to,cc,html):
    msg = MIMEMultipart('alternative')
    msg['Subject'] = sub
    msg['From'] = fromid
    msg['To'] = to
    toaddress = [to]
    if cc:
        msg['Cc'] = cc
        toaddress = to+","+ cc
        toaddress = toaddress.split(",")

    type = 'plain'
    part = MIMEText(html, type,'utf-8')
    msg.attach(part)

    s = smtplib.SMTP('localhost')
    s.sendmail(fromid,toaddress, msg.as_string())
    s.quit()
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to