Email Format Validation Function

  • Share this:

Code introduction


This function is used to validate whether an email address conforms to the email format.


Technology Stack : Django core library

Code Type : Function

Code Difficulty : Intermediate


                
                    
import random
import datetime
from django.core.validators import validate_email
from django.core.exceptions import ValidationError

def validate_email_address(email):
    try:
        validate_email(email)
        return True
    except ValidationError:
        return False