I've hooked in Gsuite as my SMTP server. It sends out emails and it works very well. However, when using the send_mail function in django, I want to indicate a from address other than the email address that I have hooked into Gsuite, which is [email protected].
subject = 'Order Confirmation'
from_email = "[email protected]"
to_email = ("[email protected]",)
txt_message = "some text"
html_message = "some other text"
send_mail(subject,
txt_message,
from_email,
to_email,
html_message=html_message,
fail_silently=False,
auth_user="[email protected]",
auth_password="PASSWORD"
)
When an email is sent out with this code, when I look at the resulting email email in the email client of [email protected], the "from" address is [email protected] rather than [email protected].
Is there a way that I can change this so that the 'from' is [email protected] or at least the 'reply-to' is [email protected]?
Thanks for your help!