Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #108985 > unrolled thread
| Started by | ragav s <raxmic@gmail.com> |
|---|---|
| First post | 2016-05-23 01:39 -0700 |
| Last post | 2016-05-24 09:23 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
Setting Return-Path in email ragav s <raxmic@gmail.com> - 2016-05-23 01:39 -0700
Re: Setting Return-Path in email Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2016-05-23 11:11 +0200
Re: Setting Return-Path in email dieter <dieter@handshake.de> - 2016-05-24 09:23 +0200
| From | ragav s <raxmic@gmail.com> |
|---|---|
| Date | 2016-05-23 01:39 -0700 |
| Subject | Setting Return-Path in email |
| Message-ID | <69c455ff-0fbd-42a5-a3fb-4ad0b89ed48e@googlegroups.com> |
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()
[toc] | [next] | [standalone]
| From | Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> |
|---|---|
| Date | 2016-05-23 11:11 +0200 |
| Message-ID | <mailman.14.1463995169.20402.python-list@python.org> |
| In reply to | #108985 |
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
[toc] | [prev] | [next] | [standalone]
| From | dieter <dieter@handshake.de> |
|---|---|
| Date | 2016-05-24 09:23 +0200 |
| Message-ID | <mailman.47.1464074614.20402.python-list@python.org> |
| In reply to | #108985 |
ragav s <raxmic@gmail.com> writes: > How can i add different Return-path and fromid in python.i have pasted the below code for preview Note that there are two different return paths associated with an email exchange: one on the protocol level (SMPT - RFC821); the other at the message level. The one on the protocol level is used for reports about delivery problems; the one at the message level is used for replies. You specify the protocol level return path as "from_addr" in your call to "smpt.sendmail". The message level return path is usually defined by the "from:" message header and can be overridden by the "reply-to" message header.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web