mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-02 16:09:08 +02:00
🔓 Allow SMTP server to be configured without auth (#556)
This commit is contained in:
parent
d14a88e9eb
commit
c6e68c407c
1 changed files with 7 additions and 4 deletions
|
@ -22,14 +22,17 @@ const getTransport = () => {
|
|||
if (env === "test") {
|
||||
transport = createTransport({ port: 4025 });
|
||||
} else {
|
||||
const hasAuth = process.env.SMTP_USER || process.env.SMTP_PWD;
|
||||
transport = createTransport({
|
||||
host: process.env.SMTP_HOST,
|
||||
port: process.env.SMTP_PORT ? parseInt(process.env.SMTP_PORT) : undefined,
|
||||
secure: process.env.SMTP_SECURE === "true",
|
||||
auth: {
|
||||
user: process.env.SMTP_USER,
|
||||
pass: process.env.SMTP_PWD,
|
||||
},
|
||||
auth: hasAuth
|
||||
? {
|
||||
user: process.env.SMTP_USER,
|
||||
pass: process.env.SMTP_PWD,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
}
|
||||
return transport;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue