kootenpv / yagmail

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

Emailing over a list of emails #171

Closed raiavincent closed 3 years ago

raiavincent commented 4 years ago

Hello,

Currently using EZGmail for a project I am working on, where I am sending an email to a list of emails found on an exterior list.

I have tried to move this process over to yagmail but have not had much luck.

Is there something I am missing or is this an upcoming feature?

The project code can be found here if more background is needed.

https://github.com/raiavincent/Daily-Meditations-Passage

kootenpv commented 4 years ago

Did you try to provide cc=list_of_emails?

On Tue, 21 Jul 2020, 17:48 Vincent Raia, notifications@github.com wrote:

Hello,

Currently using EZGmail for a project I am working on, where I am sending an email to a list of emails found on an exterior list.

I have tried to move this process over to yagmail but have not had much luck.

Is there something I am missing or is this an upcoming feature?

The project code can be found here if more background is needed.

https://github.com/raiavincent/Daily-Meditations-Passage

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kootenpv/yagmail/issues/171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU6O4542NNWD53C7RBHL2DR4W2GRANCNFSM4PDXR3IA .

raiavincent commented 4 years ago

Oh, so instead of to=list_of_emails , I should make it CC or BCC? That makes a lot more sense. I am guessing the 'to' field only accepts 1 email?

Jose-Matsuda commented 3 years ago

@raiavincent were you able to figure out how to send to a list of emails?

I've tried things like

yagmail.register('blah@gmail.com','blah')
yag = yagmail.SMTP('blah@gmail.com')
ccz = 'blah2@gmail.com blah3@gmail.com'
subject = 'This is obviously the subject'
body = 'This is obviously the body'
yag.send(cc = ccz, subject = subject, contents = body)

But I get the YagInvalidEmailAddress: Emailaddress error (I suppose as expected)

kootenpv commented 3 years ago

@raiavincent were you able to figure out how to send to a list of emails?

I've tried things like

yagmail.register('blah@gmail.com','blah')
yag = yagmail.SMTP('blah@gmail.com')
ccz = 'blah2@gmail.com blah3@gmail.com'
subject = 'This is obviously the subject'
body = 'This is obviously the body'
yag.send(cc = ccz, subject = subject, contents = body)

But I get the YagInvalidEmailAddress: Emailaddress error (I suppose as expected)

You should use a list:

ccz = ['blah2@gmail.com', 'blah3@gmail.com']
Jose-Matsuda commented 3 years ago

You should use a list:

ccz = ['blah2@gmail.com', 'blah3@gmail.com']

Well then, after reading the question again I suppose this should have been obvious / implied. Thanks!

kootenpv commented 3 years ago

You should use a list:

ccz = ['blah2@gmail.com', 'blah3@gmail.com']

Well then, after reading the question again I suppose this should have been obvious / implied. Thanks!

Hahaha yeah nice one xD