Skip to content

Commit

Permalink
Add SMTP authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
hadiahmed098 committed May 26, 2023
1 parent a842814 commit 4c82c04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions api/.env.git
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ SEND_MAIL=yes
# Details for the SMTP server designated for emails
SMTP_HOST=localhost
SMTP_PORT=25
SMTP_USERNAME=smtp-user
SMTP_PASSWORD=smtp-password
SMTP_IGNORE_TLS=true

# The URL pointing to this server
HTTP_HOST=localhost
Expand Down
6 changes: 5 additions & 1 deletion api/src/utils/mailer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ const mailer = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: process.env.SMTP_PORT,
secure: false,
ignoreTLS: true,
auth: {
user: process.env.SMTP_USERNAME,
pass: process.env.SMTP_PASSWORD,
},
ignoreTLS: process.env.SMTP_IGNORE_TLS == "true",
},{
from: "Boiler Books <boilerbooks@purdueieee.org>",
});
Expand Down

0 comments on commit 4c82c04

Please sign in to comment.