mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-03-19 15:02:08 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d38f3f7cd3 |
9
main.js
9
main.js
@@ -147,7 +147,14 @@ async function main() {
|
|||||||
// Either: "Plain Simple Name <user@doma.in>" or just "user@doma.in" (without the <>)
|
// Either: "Plain Simple Name <user@doma.in>" or just "user@doma.in" (without the <>)
|
||||||
let parsed = addressparser(from);
|
let parsed = addressparser(from);
|
||||||
if (parsed.length != 1 || parsed[0].address == '') {
|
if (parsed.length != 1 || parsed[0].address == '') {
|
||||||
throw new Error("'from' address is invalid");
|
// Report an error only if the user did not set envelope_from. Otherwise, envelope_from
|
||||||
|
// overrides from anyway and from is used as is (but Nodemailer will remove
|
||||||
|
// the From: header completely).
|
||||||
|
if (envelopeFrom) {
|
||||||
|
core.warning("'from' address is invalid. Nodemailer will not create a 'From:' header.");
|
||||||
|
} else {
|
||||||
|
throw new Error("'from' address is invalid. Maybe you want to set 'envelope_from' to a valid sender address?");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if neither to, cc or bcc is provided, throw error
|
// if neither to, cc or bcc is provided, throw error
|
||||||
|
|||||||
Reference in New Issue
Block a user