Here is the code that I am using
subject = 'Opinion - OTP for login'
message = 'Your OTP to login is {}'.format(callbacktoken)
email_from = '[email protected]'
# email_from = settings.EMAIL_HOST_USER
recipient_list = [email]
send_mail(subject, message, email_from, recipient_list)
I expect the email to show [email protected] as the name but they still show my email id that is in settings.EMAIL_HOST_USER.
How to solve this problem?
You need to own the email, Sometimes email providers require to configure to allow sending emails through apps.