django email change sender name
Step 1: Import necessary modules
from django.core.mail import EmailMessage
Step 2: Set sender name
sender_name = "Your Desired Sender Name"
Step 3: Create an EmailMessage object
email = EmailMessage(
'Subject',
'Message Body',
'[email protected]',
['[email protected]'],
['[email protected]'],
reply_to=['[email protected]'],
headers={'Message-ID': 'foo'},
)
Step 4: Set sender name in the EmailMessage object
email.from_name = sender_name
Step 5: Send the email
email.send()