mirror of
				https://github.com/dawidd6/action-send-mail.git
				synced 2025-10-31 15:16:24 +07:00 
			
		
		
		
	Merge pull request #39 from dawidd6/ignore-cert
main: ignore cert if desired
This commit is contained in:
		| @ -23,6 +23,8 @@ An action that simply sends a mail to multiple recipients. | |||||||
|     cc: kyloren@example.com,leia@example.com |     cc: kyloren@example.com,leia@example.com | ||||||
|     # Optional blind carbon copy recipients |     # Optional blind carbon copy recipients | ||||||
|     bcc: r2d2@example.com,hansolo@example.com |     bcc: r2d2@example.com,hansolo@example.com | ||||||
|  |     # Optional unsigned/invalid certificates allowance: | ||||||
|  |     ignore_cert: true | ||||||
|     # Optional content type (defaults to text/plain): |     # Optional content type (defaults to text/plain): | ||||||
|     content_type: text/html |     content_type: text/html | ||||||
|     # Optional converting Markdown to HTML (set content_type to text/html too): |     # Optional converting Markdown to HTML (set content_type to text/html too): | ||||||
|  | |||||||
| @ -35,6 +35,9 @@ inputs: | |||||||
|   bcc: |   bcc: | ||||||
|     description: Blind carbon copy recipients (separated with comma) |     description: Blind carbon copy recipients (separated with comma) | ||||||
|     required: false |     required: false | ||||||
|  |   ignore_cert: | ||||||
|  |     description: Allow unsigned/invalid certificates | ||||||
|  |     required: false | ||||||
|   content_type: |   content_type: | ||||||
|     description: Content-Type HTTP header (text/html or text/plain) |     description: Content-Type HTTP header (text/html or text/plain) | ||||||
|     required: false |     required: false | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								main.js
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.js
									
									
									
									
									
								
							| @ -44,6 +44,7 @@ async function main() { | |||||||
|         const contentType = core.getInput("content_type", { required: true }) |         const contentType = core.getInput("content_type", { required: true }) | ||||||
|         const attachments = core.getInput("attachments", { required: false }) |         const attachments = core.getInput("attachments", { required: false }) | ||||||
|         const convertMarkdown = core.getInput("convert_markdown", { required: false }) |         const convertMarkdown = core.getInput("convert_markdown", { required: false }) | ||||||
|  |         const ignoreCert = core.getInput("ignore_cert", { required: false }) | ||||||
|  |  | ||||||
|         const transport = nodemailer.createTransport({ |         const transport = nodemailer.createTransport({ | ||||||
|             host: serverAddress, |             host: serverAddress, | ||||||
| @ -53,6 +54,9 @@ async function main() { | |||||||
|                 user: username, |                 user: username, | ||||||
|                 pass: password, |                 pass: password, | ||||||
|             } |             } | ||||||
|  |             tls: ignoreCert ? { | ||||||
|  |                 rejectUnauthorized: false | ||||||
|  |             } : undefined | ||||||
|         }) |         }) | ||||||
|  |  | ||||||
|         const info = await transport.sendMail({ |         const info = await transport.sendMail({ | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Dawid Dziurla
					Dawid Dziurla