Re: Checking if email is valid

2023-11-06 Thread Simon Connah via Python-list
> I can see how the truley dim-witted might forget that other countries > have phone numbers with differing lengths and formatting/punctuation, > but there are tons of sites where it takes multiple tries when > entering even a bog-standard USA 10-0digit phone nubmer because they > are completely

Re: Checking if email is valid

2023-11-04 Thread Simon Connah via Python-list
> > > On 2023-11-02, Simon Connah simon.n.con...@protonmail.com wrote: > > > Valid as in conforms to the standard. Although having looked at the > > standard that might be more difficult than originally planned. > > > Yes. Almost nobody actually implements "the standard" as in RFC 2822 >

Re: Checking if email is valid

2023-11-04 Thread Simon Connah via Python-list
> > On 11/3/2023 6:51 AM, Jon Ribbens via Python-list wrote: > > > On 2023-11-03, Chris Angelico ros...@gmail.com wrote: > > > > > On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list > > > python-list@python.org wrote: > > > > > > > My guess is that a first test of an email address

Re: Checking if email is valid

2023-11-03 Thread Simon Connah via Python-list
> > > On 11/2/23 00:42, Simon Connah via Python-list wrote: > > > Basically I'm writing unit tests and one of them passess in a string > > with an invalid email address. I need to be able to check the string > > to see if it is a valid email so that the unit

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> Please re-read. > Discussion is about "closeness". > Thus, what you might expect from email servers and Admins, NOT what you > should do. That part should be quite evident by now! > My apologies for making a mistake. Simon. signature.asc Description: OpenPGP digital signature --

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> Agreed. > > However, with names that are frequently misspelled or which are > commonly-spelled slightly differently, the 'trick' is to anticipate > problems and set up aliases which forward messages to the correct address*. > > eg Kelvin -> Kevlin > > Niel, Neal, Neale (etc) -> Neil > >

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> > > See https://www.linuxjournal.com/article/9585?page=0,0 > That looks painful to maintain! signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> > On 2023-11-01, Chris Angelico ros...@gmail.com wrote: > > > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list > > python-list@python.org wrote: > > > > > Could someone push me in the right direction please? I just want to > > >

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> > > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list > python-list@python.org wrote: > > > Could someone push me in the right direction please? I just want to find > > out if a string is a valid email address. > > > There is only one way to

Re: Checking if email is valid

2023-11-02 Thread Simon Connah via Python-list
> > On 2023-11-01, Simon Connah via Python-list python-list@python.org wrote: > > > I'm building a simple project using smtplib and have a > > question. I've been doing unit testing but I'm not sure how to check > > if an email message is valid. > > > S

Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
Hi, I'm building a simple project using smtplib and have a question. I've been doing unit testing but I'm not sure how to check if an email message is valid. Using regex sounds like a bad idea to me and the other options I found required paying for third party services. Could someone push me

Re: Checking if email is valid

2023-11-01 Thread Simon Connah via Python-list
OK. I've been doing some reading and that you should avoid regex to check email addresses. So what I was thinking was something like this: if type(email_recipient) != email.message.Message: I just don't know why that particular line isn't working. Thank you! --- Original Message ---