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 admin@mywebsite.com.
subject = 'Order Confirmation'
from_email = "jim@gmail.com"
to_email = ("james@gmail.com",)
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="admin@mywebsite.com",
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 james@gmail.com, the "from" address is admin@mywebsite.com rather than jim@gmail.com.
Is there a way that I can change this so that the 'from' is jim@gmail.com or at least the 'reply-to' is jim@gmail.com?
Thanks for your help!