Can't change the name form which the email is being sent

177 Views Asked by At

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?

1

There are 1 best solutions below

1
On

You need to own the email, Sometimes email providers require to configure to allow sending emails through apps.