Skip to content

Commit

Permalink
Make custom secure ports available (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
a08381 authored May 3, 2021
1 parent 938c7ff commit 98b61f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Some features:
to: obiwan@example.com,yoda@example.com
# Required sender full name (address can be skipped):
from: Luke Skywalker # <user@example.com>
# Optional whether this connection use TLS (default is true if server_port is 465)
secure: true
# Optional plain body:
body: Build job of ${{github.repository}} completed successfully!
# Optional HTML body read from file:
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ inputs:
from:
description: Full name of mail sender (might be with an email address specified in <>)
required: true
secure:
description: Whether this connection use TLS (default is true if server_port is 465)
required: false
body:
description: Body of mail message (might be a filename prefixed with file:// to read from)
required: false
Expand Down
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async function main() {
const subject = core.getInput("subject", { required: true })
const from = core.getInput("from", { required: true })
const to = core.getInput("to", { required: true })
const secure = core.getInput("secure", { required: false })
const body = core.getInput("body", { required: false })
const htmlBody = core.getInput("html_body", { required: false })
const cc = core.getInput("cc", { required: false })
Expand All @@ -50,7 +51,7 @@ async function main() {
const transport = nodemailer.createTransport({
host: serverAddress,
port: serverPort,
secure: serverPort == "465",
secure: secure ? true : serverPort == "465",
auth: {
user: username,
pass: password,
Expand Down

0 comments on commit 98b61f5

Please sign in to comment.