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 person gets the e-mail, then it's 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 in the right direction please? I just want to > find out if a string is a valid email address. You'll have to define "valid". Valid syntactically according to <what>? Will be accepted by an SMTP server somewhere? Corresponds to a real person? Make sure it has an '@' in it. Possibly require at least one '.' after the '@'. Trying to do anything more than that is just wasting your time and annoying the mule. -- https://mail.python.org/mailman/listinfo/python-list