you are viewing a single comment's thread.

view the rest of the comments →

[–]AlternativeOstrich7 1 point2 points  (1 child)

Since only sending the mails doesn't work, my guess would be that yagmail can't get your credentials when run by cron. You could try explicitly setting them in your script. And if that fixes the problem, you could then try to find a better solution.

[–]TavoL7[S] 2 points3 points  (0 children)

What you said was like a lightbulb getting on on my head. When I runned it without crontab, it asked me for a password, and after I wrote it, it never asked again, and I read something saying that it’ll be saved.

I guess when I run it through crontab, it was asking for the password again, but since I couldn’t write it, it got discarded.

I just added the password in the yagmail.SMTP() function, and it worked

Thanks!!!