I wrote a python script that sends an html email that includes texts and images. I can view e-mail perfectly in gmail through gmail app or dekstop browser but images got distorted when I open it in my native iphone e-mail client(not with gamil but with my hotmail account, if that matters).
My first question: Is there any way to fix this?
If no, then my second question is: I always see beautiful e-mail campaigns that works in every email clients. How do companies achieve that?
note/ My final code to send the e-mail:
message = MIMEText(text,'html')
message['to'] = all_list
message['from'] = ''
message['subject'] = ""
raw = base64.urlsafe_b64encode(message.as_bytes())
raw = raw.decode()
message = {'raw': raw}
gmail_service.users().messages().send(userId='me', body=message).execute()
As far as I know, email HTML gets parsed differently in every mail client and the way to generate an email template that would look as expected on all of them is based on correct table usage.
If you're interested in learning more about how to do it correctly, read this article.
If you're just looking for a way to make it work, you may assist one of those email template builders:
Number 1 did the trick for me.