News for hackers. Stuff that matters.
Re:Ask HN: Create an app that sends an email with some text by librasteve on Monday September 23, 2024 @04:13PM (#41629980)
In raku,

  use Net::SMTP;

  Net::SMTP.new('smtp.gmail.com', port => 587, ssl => True)

  .login('[email protected]', 'your-password')
  .send(
    :from('[email protected]'),
    :to('[email protected]'), 
    :subject('Daily Snippet'),   
    :body('A random snippet'))
  .quit;
Then,

  crontab -e
  0 4 * * * /path/to/raku /path/to/send-email.raku

There are no comments on this comment yet.