family-richards / emailHelpers

An easy way to integrate email into your projects.
MIT License
4 stars 2 forks source link

There is a way to support Cc and Bcc functionalities? #51

Closed iMarcello closed 3 years ago

iMarcello commented 3 years ago

Hi family-richards, thanks for your package. There is a way to support Cc and Bcc functionalities? Best Regards

KTibow commented 3 years ago

BCC: In the example, just remove the metadata, but send it anyway:

from emailHelpers import Mailer, Email
fromaddr = "me@gmail.com"
toaddr = "me@gmail.com"

email = Email(fromaddr)
-email.set_to(toaddr)
email.set_subject("emailHelpers is working!")
email.set_body("Yahoo! Move on to the next step: https://family-richards.github.io/emailHelpers/#emailhelpers-docs")

mailer = Mailer(fromaddr, "IhAv3aVeRy3eCuRePa33W0Rd")
text = email.as_string()
mailer.send_mail(text, toaddr)

CC: What would your use case be? It wouldn't be too hard to code in: https://stackoverflow.com/a/29936403/12243248

KTibow commented 3 years ago

Consider closing?

iMarcello commented 3 years ago

Consider closing? YES! Hi KTibow, thanks for your fast and diligent response! Support of Cc and Bcc is not a top priority, but desirable. My use case is support automatic emails in a Telegram bot for basic surveillance weather alert service. Would be useful for not expose the personal emails account of the small group of neighbors that could receive the alert.

KTibow commented 3 years ago

Were you able to get BCC working by removing the line with set_to?

iMarcello commented 3 years ago

BCC: In the example, just remove the metadata, but send it anyway:

from emailHelpers import Mailer, Email
fromaddr = "me@gmail.com"
toaddr = "me@gmail.com"

email = Email(fromaddr)
-email.set_to(toaddr)
email.set_subject("emailHelpers is working!")
email.set_body("Yahoo! Move on to the next step: https://family-richards.github.io/emailHelpers/#emailhelpers-docs")

mailer = Mailer(fromaddr, "IhAv3aVeRy3eCuRePa33W0Rd")
text = email.as_string()
mailer.send_mail(text, toaddr)

CC: What would your use case be? It wouldn't be too hard to code in: https://stackoverflow.com/a/29936403/12243248

KTibow, I explain the use case. I at the moment code using smtlib however I liked your librarya lot ahaha. You rock! Thanks

iMarcello commented 3 years ago

Were you able to get BCC working by removing the line with set_to?

Yes, works ok!

KTibow commented 3 years ago

So what's your current status? Looking for CC functionality? CC just tells people that they aren't the main recipient, but everyone can see that they're on the list.

iMarcello commented 3 years ago

So what's your current status? Looking for CC functionality? CC just tells people that they aren't the main recipient, but everyone can see that they're on the list. At the moment I use the code with smtplib with both Cc and Bcc and text utf-8 for the body with weather conditions as text like: Condiciones: TICUANTEPE,Nicaragua: ⛅️ , Partly cloudy, +20°C, ←14km/h, 0.0mm However I would like include some attachments and I found your library pretty simple to manage attaches and very intuitive!

KTibow commented 3 years ago

And you can use set_attr for stuff: https://github.com/family-richards/emailHelpers/blob/master/README.md#custom-headers

iMarcello commented 3 years ago

And you can use set_attr for stuff: https://github.com/family-richards/emailHelpers/blob/master/README.md#custom-headers

A BIG Thanks again KTibow ! I forgot to mention Im not a SW developer neither code specialist, only an enthusiast! However I think I got the idea.

KTibow commented 3 years ago

I'm going to close this if you don't mind. I think both parts should be solved now.