RE: Checking if email is valid

2023-11-07 Thread AVI GROSS via Python-list
To: python-list@python.org Subject: Re: Checking if email is valid On 2023-11-07 08:40, Grant Edwards via Python-list wrote: > If you, as a web developer, want the user to enter a text-message > capable phone number, then ASK FOR THAT! And you may as well ask if they even want you to send

Re: Checking if email is valid

2023-11-07 Thread D'Arcy Cain via Python-list
On 2023-11-07 08:40, Grant Edwards via Python-list wrote: If you, as a web developer, want the user to enter a text-message capable phone number, then ASK FOR THAT! And you may as well ask if they even want you to send texts whether they can technically receive them or not. -- D'Arcy J.M.

Re: Checking if email is valid

2023-11-07 Thread Grant Edwards via Python-list
On 2023-11-06, Greg Ewing via Python-list wrote: > On 7/11/23 7:45 am, Mats Wichmann wrote: >> Continuing with the example, if you have a single phone number field, or >> let a mobile number be entered in a field marked for landline, you will >> probably assume you can text to that number. > >

Re: Checking if email is valid

2023-11-06 Thread rbowman via Python-list
On Tue, 7 Nov 2023 12:11:18 +1300, Greg Ewing wrote: > On 6/11/23 6:34 pm, rbowman wrote: >> We've found even if you directly ask the user often the answer is 'I >> dunno' or some mythology they have constructed to explain the problem. > > This seems to apply to hardware issues as well. Louis

RE: Checking if email is valid

2023-11-06 Thread AVI GROSS via Python-list
, 2023 6:20 PM To: python-list@python.org Subject: Re: Checking if email is valid On Tue, 7 Nov 2023 at 10:11, Greg Ewing via Python-list wrote: > > On 7/11/23 7:45 am, Mats Wichmann wrote: > > Continuing with the example, if you have a single phone number field, or > > l

Re: Checking if email is valid

2023-11-06 Thread Chris Angelico via Python-list
On Tue, 7 Nov 2023 at 10:11, Greg Ewing via Python-list wrote: > > On 7/11/23 7:45 am, Mats Wichmann wrote: > > Continuing with the example, if you have a single phone number field, or > > let a mobile number be entered in a field marked for landline, you will > > probably assume you can text to

Re: Checking if email is valid

2023-11-06 Thread Greg Ewing via Python-list
On 6/11/23 6:34 pm, rbowman wrote: We've found even if you directly ask the user often the answer is 'I dunno' or some mythology they have constructed to explain the problem. This seems to apply to hardware issues as well. Louis Rossmann has a philosophy of "Never believe what the customer

Re: Checking if email is valid

2023-11-06 Thread Greg Ewing via Python-list
On 7/11/23 7:45 am, Mats Wichmann wrote: Continuing with the example, if you have a single phone number field, or let a mobile number be entered in a field marked for landline, you will probably assume you can text to that number. But if the site can detect that you've entered a mobile number

Re: Checking if email is valid

2023-11-06 Thread Chris Angelico via Python-list
On Tue, 7 Nov 2023 at 07:10, Mats Wichmann via Python-list wrote: > Suggests maybe labeling should be something like: > > * Number you want to be called on > * Number for texted security messages, if different > > Never seen that, though :-) > My responses would be: * Don't. * That's what

Re: Checking if email is valid

2023-11-06 Thread Mats Wichmann via Python-list
On 11/6/23 08:23, Jon Ribbens via Python-list wrote: On 2023-11-06, Mats Wichmann wrote: On 11/6/23 01:57, Simon Connah via Python-list wrote: The thing I truly hate is when you have two telephone number fields. One for landline and one for mobile. I mean who in hell has a landline these

Re: Checking if email is valid

2023-11-06 Thread Chris Angelico via Python-list
On Tue, 7 Nov 2023 at 02:05, Jon Ribbens via Python-list wrote: > That was another thing that I used to find ridiculous, but seems to have > improved somewhat in recent years - website error pages that said "please > contact us to let us know about this error". I'm sorry, what? You want > me to

Re: Checking if email is valid

2023-11-06 Thread MRAB via Python-list
On 2023-11-06 08:57, Simon Connah via Python-list wrote: 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

Re: Checking if email is valid

2023-11-06 Thread Jon Ribbens via Python-list
On 2023-11-06, Mats Wichmann wrote: > On 11/6/23 01:57, Simon Connah via Python-list wrote: >> The thing I truly hate is when you have two telephone number fields. >> One for landline and one for mobile. I mean who in hell has a >> landline these days? > > People who live in places with spotty,

Re: Checking if email is valid

2023-11-06 Thread Jon Ribbens via Python-list
On 2023-11-06, D'Arcy Cain wrote: > On 2023-11-05 06:48, Jon Ribbens via Python-list wrote: >> Sometimes I think that these sorts of stupid, wrong, validation are the >> fault of idiot managers. When it's apostrophes though I'm suspicious >> that it may be idiot programmers who don't know how to

Re: Checking if email is valid

2023-11-06 Thread Mats Wichmann via Python-list
On 11/6/23 01:57, Simon Connah via Python-list wrote: The thing I truly hate is when you have two telephone number fields. One for landline and one for mobile. I mean who in hell has a landline these days? People who live in places with spotty, or no, mobile coverage. We do exist. --

Re: Checking if email is valid

2023-11-06 Thread rbowman via Python-list
On Sun, 5 Nov 2023 19:22:49 -0600, D'Arcy Cain wrote: > Gotta wonder for sure. It could also be the case of programmers > depending on user input but the users insist on living with the bugs > and/or working around them. We made crash reporting dead simple to > report on and still users didn't

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-05 Thread D'Arcy Cain via Python-list
On 2023-11-05 06:48, Jon Ribbens via Python-list wrote: Sometimes I think that these sorts of stupid, wrong, validation are the fault of idiot managers. When it's apostrophes though I'm suspicious that it may be idiot programmers who don't know how to prevent SQL injection attacks without just

Re: Checking if email is valid

2023-11-05 Thread Jon Ribbens via Python-list
On 2023-11-05, Grant Edwards wrote: > On 2023-11-05, D'Arcy Cain via Python-list wrote: >> On 2023-11-05 00:39, Grant Edwards via Python-list wrote: >>> Definitely. Syntactic e-mail address "validation" is one of the most >>> useless and widely broken things on the Interwebs. People who do >>>

Re: Checking if email is valid

2023-11-05 Thread Mats Wichmann via Python-list
On 11/5/23 10:34, Grant Edwards via Python-list wrote: Indeed. There is a tiny but brightly burning kernel of hate in my heart for web sites (and their developers) that refuse to accept credit card numbers entered with spaces _as_they_are_shown_on_the_card_! I've concluded that using PHP

Re: Checking if email is valid

2023-11-05 Thread Jon Ribbens via Python-list
On 2023-11-05, D'Arcy Cain wrote: > On 2023-11-05 00:39, Grant Edwards via Python-list wrote: >> Definitely. Syntactic e-mail address "validation" is one of the most >> useless and widely broken things on the Interwebs. People who do >> anything other than require an '@' (and optionally make you

Re: Checking if email is valid

2023-11-05 Thread Grant Edwards via Python-list
On 2023-11-05, D'Arcy Cain via Python-list wrote: > On 2023-11-05 00:39, Grant Edwards via Python-list wrote: >> Definitely. Syntactic e-mail address "validation" is one of the most >> useless and widely broken things on the Interwebs. People who do >> anything other than require an '@' (and

Re: Checking if email is valid

2023-11-05 Thread gene heskett via Python-list
On 11/5/23 05:32, D'Arcy Cain via Python-list wrote: On 2023-11-05 00:39, Grant Edwards via Python-list wrote: Definitely. Syntactic e-mail address "validation" is one of the most useless and widely broken things on the Interwebs.  People who do anything other than require an '@' (and

RE: Checking if email is valid

2023-11-05 Thread AVI GROSS via Python-list
by supplying your valid email address, then checking if it looks valid is less useful than sending an email to that address and asking the recipient to opt-in and verify they legitimately want it. If you want to ensure that your newsletter is still wanted, you may do something similar every year or so

Re: Checking if email is valid

2023-11-05 Thread D'Arcy Cain via Python-list
On 2023-11-05 00:39, Grant Edwards via Python-list wrote: Definitely. Syntactic e-mail address "validation" is one of the most useless and widely broken things on the Interwebs. People who do anything other than require an '@' (and optionally make you enter the same @-containing string twice)

Re: Checking if email is valid

2023-11-04 Thread Grant Edwards via Python-list
On 2023-11-04, Michael Torrie via Python-list wrote: > On 11/4/23 02:51, Simon Connah via Python-list wrote: > >> Wow. I'm half tempted to make a weird email address to see how many >> websites get it wrong. In my experience, they don't have to be very weird at all. >> Thank you for the link. >

Re: Checking if email is valid

2023-11-04 Thread Michael Torrie via Python-list
On 11/4/23 02:51, Simon Connah via Python-list wrote: > Wow. I'm half tempted to make a weird email address to see how many websites > get it wrong. > > Thank you for the link. Nearly all websites seem to reject simple correct email addresses such as myemail+sometext@example.domain. I like to

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 Thomas Passin via Python-list
On 11/3/2023 6:51 AM, Jon Ribbens via Python-list wrote: On 2023-11-03, Chris Angelico wrote: On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list wrote: My guess is that a first test of an email address might be to see if a decent module of that kind fills out the object to your

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 test passess. > > > If you

Re: Checking if email is valid

2023-11-03 Thread Grant Edwards via Python-list
On 2023-11-02, Michael Torrie via Python-list wrote: > On 11/2/23 00:42, Simon Connah via Python-list wrote: > >> Valid as in conforms to the standard. Although having looked at the >> standard that might be more difficult than originally planned. > > You'll have to read the relevant RFCs. Lots

RE: Checking if email is valid

2023-11-03 Thread AVI GROSS via Python-list
addresses. -Original Message- From: Python-list On Behalf Of Chris Angelico via Python-list Sent: Friday, November 3, 2023 1:43 AM To: python-list@python.org Subject: Re: Checking if email is valid On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list wrote: > My guess is that a first t

Re: Checking if email is valid

2023-11-03 Thread Jon Ribbens via Python-list
On 2023-11-03, Chris Angelico wrote: > On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list > wrote: >> My guess is that a first test of an email address might be to see if >> a decent module of that kind fills out the object to your >> satisfaction. You can then perhaps test parts of the

Re: Checking if email is valid

2023-11-02 Thread Chris Angelico via Python-list
On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list wrote: > My guess is that a first test of an email address might be to see if a decent > module of that kind fills out the object to your satisfaction. You can then > perhaps test parts of the object, rather than everything at once, to see

RE: Checking if email is valid

2023-11-02 Thread AVI GROSS via Python-list
To: python-list@python.org Subject: Re: Checking if email is valid If i wanted an email verifier I would look at open source frameworks and see how they do it. Django comes to mind.--(Unsigned mail from my phone) Original message From: Michael Torrie via Python-list Date: 3/11/23 07

Re: Checking if email is valid

2023-11-02 Thread Chris Angelico via Python-list
On Fri, 3 Nov 2023 at 07:17, Jon Ribbens via Python-list wrote: > > On 2023-11-02, Simon Connah 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

Re: Checking if email is valid

2023-11-02 Thread Mike Dewhirst via Python-list
: Checking if email is valid 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 test passess.If

Re: Checking if email is valid

2023-11-02 Thread Michael Torrie 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 test passess. If you truly have managed to code an

Re: Checking if email is valid

2023-11-02 Thread Jon Ribbens via Python-list
On 2023-11-02, Simon Connah 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 section 3.4.1 (which can contain, for example,

Re: Checking if email is valid

2023-11-02 Thread D'Arcy Cain via Python-list
On 2023-11-02 00:18, AVI GROSS via Python-list wrote: Yes, it would be nice if there was a syntax for sending a test message sort of like an ACK that is not delivered to the recipient but merely results in some status being sent back such as DELIVERABLE or NO SUCH USER or even MAILBOX FULL. It

RE: Checking if email is valid

2023-11-02 Thread AVI GROSS via Python-list
via Python-list Sent: Thursday, November 2, 2023 2:05 AM To: python-list@python.org Subject: Re: Checking if email is valid On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list wrote: > > Yes, it would be nice if there was a syntax for sending a test message sort > of li

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 D'Arcy Cain via Python-list
On 2023-11-02 02:04, Chris Angelico via Python-list wrote: On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list wrote: Yes, it would be nice if there was a syntax for sending a test message sort of like an ACK that is not delivered to the recipient but merely results in some status being

Re: Checking if email is valid

2023-11-02 Thread Dan Purgert via Python-list
On 2023-11-02, dn wrote: > On 02/11/2023 19.46, Simon Connah via Python-list wrote: >> [...] >> My goal is to make a simple mailing list platform. I guess I could >> just send email to an address and if it bounces then I can remove it >> from the database. Thing is I'm not sure how close to a real

Re: Checking if email is valid

2023-11-02 Thread Alan Bawden via Python-list
Chris Angelico writes: On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list wrote: > Yes, it would be nice if there was a syntax for sending a test > message sort of like an ACK that is not delivered to the recipient > but merely results in some status being sent back such as

Re: Checking if email is valid

2023-11-02 Thread Jon Ribbens via Python-list
On 2023-11-02, D'Arcy Cain wrote: > On 2023-11-01 17:17, Chris Angelico via Python-list wrote: >> On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list >> wrote: >>> Make sure it has an '@' in it. Possibly require at least one '.' >>> after the '@'. >> >> No guarantee that there'll be a

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
On 02/11/2023 20.28, Simon Connah wrote: I'm not sure that would be practical. As I'm setting up a mailing list server I don't know if someone in the future is going to need to use one of those aliases and testing manually would be tedious. Please re-read. Discussion is about "closeness".

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 Grizzy Adams via Python-list
Thursday, November 02, 2023 at 6:46, Simon Connah via Python-list wrote: Re: Checking if email is valid (at least in part) >My goal is to make a simple mailing list platform. I guess I could just send >email to an address and if it bounces then I can remove it from the database. That fu

Re: Checking if email is valid

2023-11-02 Thread dn via Python-list
On 02/11/2023 19.56, Chris Angelico via Python-list wrote: On Thu, 2 Nov 2023 at 17:47, Simon Connah wrote: My goal is to make a simple mailing list platform. I guess I could just send email to an address and if it bounces then I can remove it from the database. Thing is I'm not sure how

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 dn via Python-list
On 02/11/2023 19.46, Simon Connah via Python-list 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 find out if a string is a valid email address. There is only one way

Re: Checking if email is valid

2023-11-02 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 17:47, Cameron Simpson via Python-list wrote: > > On 02Nov2023 17:04, Chris Angelico wrote: > >On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list > > wrote: > >> Yes, it would be nice if there was a syntax for sending a test > >> message sort > >> of like an ACK that is

Re: Checking if email is valid

2023-11-02 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 17:47, Simon Connah wrote: > > My goal is to make a simple mailing list platform. I guess I could just send > email to an address and if it bounces then I can remove it from the database. > Thing is I'm not sure how close to a real email address an email has to be in >

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 > > > find out if a string is a valid email address. > >

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 know that a string is a valid email

Re: Checking if email is valid

2023-11-02 Thread Cameron Simpson via Python-list
On 02Nov2023 17:04, Chris Angelico wrote: On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list wrote: Yes, it would be nice if there was a syntax for sending a test message sort of like an ACK that is not delivered to the recipient but merely results in some status being sent back such as

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. > > > Send an e-mail using it? If the right

Re: Checking if email is valid

2023-11-02 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list wrote: > > Yes, it would be nice if there was a syntax for sending a test message sort > of like an ACK that is not delivered to the recipient but merely results in > some status being sent back such as DELIVERABLE or NO SUCH USER or even >

RE: Checking if email is valid

2023-11-01 Thread AVI GROSS via Python-list
universities that were densely connected to others got lots of traffic. In that scenario, validity had another meaning. -Original Message- From: Python-list On Behalf Of D'Arcy Cain via Python-list Sent: Wednesday, November 1, 2023 9:57 PM To: python-list@python.org Subject: Re: Checking if email

Re: Checking if email is valid

2023-11-01 Thread Ian Hobson via Python-list
See https://www.linuxjournal.com/article/9585?page=0,0 On 01/11/2023 17:09, Simon Connah via Python-list wrote: 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

Re: Checking if email is valid

2023-11-01 Thread D'Arcy Cain via Python-list
On 2023-11-01 17:17, Chris Angelico via Python-list wrote: On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list wrote: Make sure it has an '@' in it. Possibly require at least one '.' after the '@'. No guarantee that there'll be a dot after the at. (Technically there's no guarantee of

Re: Checking if email is valid

2023-11-01 Thread Cameron Simpson via Python-list
On 01Nov2023 14:08, Grant Edwards wrote: On 2023-11-01, Simon Connah via Python-list 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. [...] Could someone push me in the right

Re: Checking if email is valid

2023-11-01 Thread Michael Torrie via Python-list
On 11/1/23 04:09, Simon Connah via Python-list wrote: > 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 >

Re: Checking if email is valid

2023-11-01 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 08:52, Grant Edwards via Python-list wrote: > > On 2023-11-01, Chris Angelico via Python-list wrote: > > On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list > > wrote: > > >> Make sure it has an '@' in it. Possibly require at least one '.' > >> after the '@'. > > >

Re: Checking if email is valid

2023-11-01 Thread Grant Edwards via Python-list
On 2023-11-01, Chris Angelico via Python-list wrote: > On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list > wrote: >> Make sure it has an '@' in it. Possibly require at least one '.' >> after the '@'. > > No guarantee that there'll be a dot after the at. Ah, I forgot about defaulting

Re: Checking if email is valid

2023-11-01 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list wrote: > Make sure it has an '@' in it. Possibly require at least one '.' > after the '@'. No guarantee that there'll be a dot after the at. (Technically there's no guarantee of an at sign either, but email addresses without at signs

Re: Checking if email is valid

2023-11-01 Thread Grant Edwards via Python-list
On 2023-11-01, Simon Connah via Python-list 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. Send an e-mail using it? If the right person gets the e-mail, then it's valid? >

Re: Checking if email is valid

2023-11-01 Thread De ongekruisigde via Python-list
On 2023-11-01, Mats Wichmann wrote: > On 11/1/23 05:35, Simon Connah via Python-list wrote: >> 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: > > To be a little more specific, Avoid Rolling Your Own

Re: Checking if email is valid

2023-11-01 Thread dn via Python-list
On 02/11/2023 00.35, Simon Connah via Python-list wrote: OK. I've been doing some reading and that you should avoid regex to check email addresses. This operation used to be a BIG THING back in the days of 'everyone' building PHP web-sites. When there were only a handful of TLDs (top-level

Re: Checking if email is valid

2023-11-01 Thread Mats Wichmann via Python-list
On 11/1/23 05:35, Simon Connah via Python-list wrote: 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: To be a little more specific, Avoid Rolling Your Own RegEx. It's very tricky, and you will get it

Re: Checking if email is valid

2023-11-01 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 06:02, Jon Ribbens via Python-list wrote: > > On 2023-11-01, Chris Angelico wrote: > > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list > > wrote: > >> Could someone push me in the right direction please? I just want to > >> find out if a string is a valid email

Re: Checking if email is valid

2023-11-01 Thread Jon Ribbens via Python-list
On 2023-11-01, Chris Angelico wrote: > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list > 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 know that a string is a valid email

Re: Checking if email is valid

2023-11-01 Thread Chris Angelico via Python-list
On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list 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 know that a string is a valid email address, and that's to send an email to it.

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 ---