9

I am playing around with the python mailjet api, and found that I can set the sender's name so instead of emails showing up from "Info" (info@example.com) I can have them show up from "Carlos". I would also like to add a profile picture like that of Southwest Airlines or Twitter.

enter image description here

Anyone have any idea how I might do that?

I know that if I don't post code then people get angry, so here's some code:

mailjet = Client(auth=(API_KEY, API_PASSWORD), version='v3.1')
data = {
    'Messages': [
        {
            "From": {
                "Email": "info@example.com",
                "Name": "Carlos"
            },
            "To": [
                {
                    "Email": trip.email
                }
            ],
            "Subject": "Subject of the message",
            "TextPart":"This is the body of the message",
            "Headers": {
                    "X-My-Header": "https://www.example.com/profile_pic.png"
            }
        }
    ]
}
mailjet.send.create(data=data)
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
  • 1
    Which mail program is that image from? Do you mean the icon in GMail/Inbox, which apparently [needs a verified Google+ presence](http://freshinbox.com/blog/how-to-get-your-logo-to-display-in-gmail-grid-view/). – Ken Y-N Oct 27 '17 at 03:05
  • It is... Looking at the link now. Thanks. – Chase Roberts Oct 29 '17 at 03:30

1 Answers1

6

2022 update: The best method for this is BIMI, Brand Indicators for Message Identification.

BIMI uses DMARC to ensure authenticity and then allows specifying a brand logo registered as a trademark to be displayed in email clients (Google calls this a Verified Mark Certificate).

I don't think there's a specification yet (see the IETF BIMI draft from 2021), so the best resource is the BIMI Group itself.


There are two headers out there that may (but probably won't) work for you:

  1. X-Face
  2. X-Image-URL

Neither has great support. X-Image-URL was supported in Apple Mail until v4.5.

It's not a header, but I think Gravatar is probably the closest thing to what you're looking for. With a Gravatar account, you can post an image to match your email's MD5 hash for various websites and email clients to pick up. There are a few implementations of email client helpers/extensions/add-ons that apply sender email Gravatars to a message, including Thunderbird's Contact Photos add-on, but that doesn't even have broad adoption on Thunderbird, which itself doesn't have broad adoption.

I can't comment on how it's done with Google specifically, but many enterprise systems simply propagate your image from your account profile.

Note that this does introduce a new confidence indicator that can be abused by phishing attacks, though I haven't seen one yet.

Adam Katz
  • 14,455
  • 5
  • 68
  • 83