Re: How to manage accented characters in mail header?

Liste des GroupesRevenir à cl python 
Sujet : Re: How to manage accented characters in mail header?
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 04. Jan 2025, 20:40:34
Autres entêtes
Organisation : Stefan Ram
Message-ID : <parseaddr-20250104204008@ram.dialup.fu-berlin.de>
References : 1 2 3
Chris Green <cl@isbd.net> wrote or quoted:
print(final_string)# From: Sébastien Crignon <sebastien.crignon@amvs.fr>
Is there a simple[r] way to extract just the 'real' address between
the <>, that's all I actually need.  I think it has the be the last
chunk of the From: doesn't it?

  Besides the deal with the pointy brackets, there's also this
  other setup with round ones, like in

sebastien.crignon@amvs.fr (Sébastien Crignon)

  . The standard library has:

email.utils.parseaddr(address)

Parse address – which should be the value of some
address-containing field such as To or Cc - into its
constituent realname and email address parts. Returns a tuple
of that information, unless the parse fails, in which case a
2-tuple of ('', '') is returned.

  .




 

Date Sujet#  Auteur
4 Jan 25 * How to manage accented characters in mail header?6Chris Green
4 Jan 25 +* Re: How to manage accented characters in mail header?4Stefan Ram
4 Jan 25 i`* Re: How to manage accented characters in mail header?3Chris Green
4 Jan 25 i +- Re: How to manage accented characters in mail header?1Stefan Ram
6 Jan 25 i `- Re: How to manage accented characters in mail header?1Peter J. Holzer
4 Jan 25 `- Re: How to manage accented characters in mail header?1Peter Pearson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal