I am trying to send a verification SMS or an e-mail to the user.
I find that using Python libraries like 'smtplib' or third-party libraries like 'sendgrid' can send a verification e-mail or an SMS to the user but I don't have a better idea.
That I am expecting a most suitable way to send a verification e-mail or an SMS to the user without using API
An API is required, or more specifically a server. Python cannot just send texts or emails without sending a network request to some server that's able to process such information, such an SMTP mail server for emails. If you could plainly send texts from builtin software libraries, then you'd have a lot more spam messages