Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Vincent Vande Vyvre Newsgroups: comp.lang.python Subject: Re: Setting Return-Path in email Date: Mon, 23 May 2016 11:11:00 +0200 Lines: 30 Message-ID: References: <69c455ff-0fbd-42a5-a3fb-4ad0b89ed48e@googlegroups.com> <5742C924.1000504@telenet.be> Reply-To: vincent.vandevyvre@oqapy.eu Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de Funv2ghwGAuI4v/7UFQTSggsRk8O/m5dZn10GI8IZqCg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.039 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'msg': 0.07; 'sub': 0.09; 'def': 0.13; 'from:name:vincent vande vyvre': 0.16; 'received:195.130': 0.16; 'received:195.130.137': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:telenet- ops.be': 0.16; '\xe9crit': 0.16; 'all,': 0.20; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'code': 0.30; 'received:be': 0.30; 'skip:s 30': 0.31; 'add': 0.34; 'cc:': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'different': 0.63; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'adress': 0.91; 'subject:Setting': 0.96 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <69c455ff-0fbd-42a5-a3fb-4ad0b89ed48e@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5742C924.1000504@telenet.be> X-Mailman-Original-References: <69c455ff-0fbd-42a5-a3fb-4ad0b89ed48e@googlegroups.com> Xref: csiph.com comp.lang.python:108986 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