English | 简体中文
A simple node program that automatically sends you the leetcode
daily question every day, using leetcode-daily-question to get the daily question, and nodemailer to send emails, the result is as follows
- The current service is deployed on
vercel
(no payment required) You can deploy your own service directly by clicking on the button - Set the required environment variables
env_name desc example require default EMAIL_LANGUAGE Language of email content( en
orcn
)en false cn FROM_EMAIL email to send daily questions send@mail.com true TO_EMAIL The email address to receive the daily question (multiple, separated by commas) receiver1@mail.com,receiver2@mail.com true SMTP_EMAIL_HOST SMTP domain name of the sender's mailbox smtp.gmail.com true SMTP_PORT SMTP port of the sender's mailbox 465 false 465 AUTH_USER The account number of the sender's mailbox send@mail.com true AUTH_PASS Password of the sender's mailbox password true - in the
. /vercel.json
file to set the sending time, note thatvercel
uses the UTC time zone, the following indicates that it will be sent at 1:00 a.m. every day in the UTC time zone, corresponding to 9:00 a.m. in the UTC+8 time zone
{
"crons": [
{
"path": "/api/send",
"schedule": "0 1 * * *"
}
]
}
- After deployment, you can directly access the
/api/send
path to test whether the send is successful
- clone project
- Set the environment variables locally, create an
.env' file in the project root directory, and set the necessary environment variables in the
.env' file - Install
vercel cli
tool according to https://vercel.com/docs/cli - Start the project with 'vercel dev
- Visit
https://localhost:3000/api/send