Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending the same email with different attachments to different recipients but the script stops running after 3-4 iterations every time and also the first few mails take 10-15 seconds to send each #260

Open
kdarsh17 opened this issue Nov 22, 2022 · 0 comments

Comments

@kdarsh17
Copy link

kdarsh17 commented Nov 22, 2022

My code:

import yagmail
import pandas as pd
import os

data = pd.read_csv('studentscomp32.csv', header=0)
Name = data['Name']
Mail = data['Email']
Course = data['Course']
yag = yagmail.SMTP("[email protected]", "pw")
`try:`
    for i in range(len(Name)):
        yag.send(Mail[i],"Certificate of Completion for the course "+Course[i]+" awarded to "+Name[i]," Congratulations, attached with this email is your certificate", attachments=['/home/kyez/Code/CTE Mailer/comp32/'+Name[i]+'.pdf'])
        print("Success")
except:
    print("Fail")

```        ``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant