I am working on a Django application that can allow users to send emails from their emails or from their domain emails after verification, I intended to use Zoho SMTP for sending emails, I wrote a function like so:
def send_email(subject, to_list, from_email, text_content, content): email_message = mail.EmailMultiAlternatives( subject=subject, body=text_content, to=tuple(to_list), from_email=from_email, ) email_message.attach_alternative(content, "text/html") email_message.send()
The problem is that it always throws smtplib.SMTPDataError: (553, b'Relaying disallowed as abc@gmail.com'). Although, the first time I tried, it sent an email with an included via mydomain.com in the from section.
How can I achieve the following without having to set up my own SMTP server: website
via in the from section of the received email.MX Records or somethingAny links, suggestions would be highly appreciated. Thanks