Setting Return-Path in email

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Mon May 23 05:11:00 EDT 2016


Le 23/05/2016 10:39, ragav s a écrit :
> 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()


Try with
msg['Reply-To'] = the adress

Vincent



More information about the Python-list mailing list