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" ([email protected]) I can have them show up from "Carlos". I would also like to add a profile picture like that of Southwest Airlines or Twitter.
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": "[email protected]",
"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)
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 icon to be displayed in email clients. Google has supported it since 2020, but BIMI didn't exist back in 2018 when I composed this original answer.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With