kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.66k stars 265 forks source link

Add ability to specify a separate login username and "from" address (required for AWS SES) #122

Open kwellman opened 6 years ago

kwellman commented 6 years ago

I'm using AWS SES and they give you what looks like a random string to use as your login username for their SMTP servers. Is this supported? It seems like yagmail requires a login username that is a valid email address. I understand that this limitation is intentional to prevent email address spoofing but it makes this library useless for AWS SES.

kootenpv commented 6 years ago

@kwellman This has been brought up before, but indeed I have no intention of supporting spoofing.

This is a real use-case though.

I'm not sure if this is "important" (with all respect) when it is the first time it is being requested after all this time (whereas other cases were related to spoofing). The main target of the library was Gmail after all.

I'll keep it in mind and might add it eventually, but I'm sorry to disappoint there is no way to do it right now.

simaogomes commented 5 years ago

I have tried to use it with Gmail and had tha same request. Need to login from a Gsuite email and then send an email as an alias. But because I have to logIn with the From adress Gmail kicks me Out. Need to be logged first to then send an email as an Alias. Separated From adress from the Login adress it's a very important feature.

obsidiandevel commented 3 years ago

I've made the small changes required. Happy to create a pull request.

MarvinGS commented 1 year ago

You can configure Aliases in Gmail and send from these Addresses, too. They only allow validated Aliases to keep you from Spoofing. If you try to use a non-validated Alias they fall back to the default Alias.

sec-chethan commented 1 year ago

May be it's high time Yagmail supports AWS SES credential login, all are perfect but this piece of feature is missing which makes us choose alternatives.

kootenpv commented 1 year ago

May be it's high time Yagmail supports AWS SES credential login, all are perfect but this piece of feature is missing which makes us choose alternatives.

Would very much welcome a PR 💯

lightningorb commented 1 year ago

May be it's high time Yagmail supports AWS SES credential login, all are perfect but this piece of feature is missing which makes us choose alternatives.

Would very much welcome a PR 💯

Strange I had a PR for this but can no longer find it. Oh well it was very small.

Anyway Yagmail was by far the simplest and best Python library for sending email, and adding AWS SES support was very simple. Anyone seeing this in the future do please create a PR.

kootenpv commented 1 year ago

Do you remember what was needed @lightningorb?

lightningorb commented 1 year ago

Nope :(