Responsiveness of HTML emails

I’m currently engaged in a project where I need to craft responsive HTML emails for clients. My main hurdle is ensuring that these emails display correctly across different devices. Could anyone advise on the best practices for testing the responsiveness of HTML emails?

1 Like

It’s not just devices, it’s also email clients (e.g. Outlook, Thunderbird, Gmail, iPad email, Samsung email, etc, etc, etc).

There is no generally-accepted standard for html rendering in an email client. This means you’d need to test on every email client package for every operating system being used to retrieve those emails. (A quick internet search on this topic shows what a mess the current situation is.)

Best of luck to you.

1 Like

Hi Lukas, I suggest trying out Mailtrap as a mail server for testing purposes because it offers a straightforward approach to sending HTML emails and provides the features needed for your task.
Below, I’ll share a few Flask code examples that demonstrate how to send an email using the Mailtrap server.

from django.core.mail import EmailMessage
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt

# Configure your email settings in Django
# EMAIL_PORT = 587
# EMAIL_HOST_PASSWORD = 'your-email-password'

def send_email(request):
    if request.method == 'POST':
        smtp_server = ''
        smtp_port = 587
        smtp_user = 'username'  # Replace with your MAILTRAP username
        smtp_password = 'password'  # Replace with your MAILTRAP password

        subject = 'New Form Submission'
        body = 'This is the form submission content'
        from_email = ''  # Replace with your sender email
        to_email = ['']  # Replace with your receiver email list

            email = EmailMessage(
            return HttpResponse("Email sent successfully!")
        except Exception as e:
            return HttpResponse(f"Error: {str(e)}")
        return HttpResponse("This endpoint only accepts POST requests.")