mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-11-10 05:51:07 +07:00
main: try catch block
This commit is contained in:
parent
fced312130
commit
ae7db41acb
20
main.js
20
main.js
@ -12,14 +12,15 @@ function get_body(body) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
server_address = core.getInput("server_address", {required: true})
|
||||
server_port = core.getInput("server_port", {required: true})
|
||||
username = core.getInput("username", {required: true})
|
||||
password = core.getInput("password", {required: true})
|
||||
subject = core.getInput("subject", {required: true})
|
||||
body = core.getInput("body", {required: true})
|
||||
to = core.getInput("to", {required: true})
|
||||
from = core.getInput("from", {required: true})
|
||||
try {
|
||||
server_address = core.getInput("server_address", { required: true })
|
||||
server_port = core.getInput("server_port", { required: true })
|
||||
username = core.getInput("username", { required: true })
|
||||
password = core.getInput("password", { required: true })
|
||||
subject = core.getInput("subject", { required: true })
|
||||
body = core.getInput("body", { required: true })
|
||||
to = core.getInput("to", { required: true })
|
||||
from = core.getInput("from", { required: true })
|
||||
html = core.getInput("html") || "false"
|
||||
|
||||
transport = nodemailer.createTransport({
|
||||
@ -41,6 +42,9 @@ async function main() {
|
||||
})
|
||||
|
||||
console.log(info)
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
Loading…
Reference in New Issue
Block a user