# Intermittent error 403 with Email node

**URL:** <https://discourse.nodered.org/t/intermittent-error-403-with-email-node/60324>\
**Category:** General\
**Created:** [25 March 2022 07:03 UTC](https://discourse.nodered.org/t/intermittent-error-403-with-email-node/60324 "2022-03-25T07:03:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashfaak](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ashfaak/32/34409_2.png) [@Ashfaak](https://discourse.nodered.org/u/Ashfaak)\
**Post date:** [25 March 2022 07:03 UTC](https://discourse.nodered.org/t/intermittent-error-403-with-email-node/60324/1 "2022-03-25T07:03:51Z")

</div>

Hi

NR v2.2.2  
node-red-node-email 1.14.0

I've been getting intermittent faults sending emails recently. ~3/10 nearly identical emails fail. Not sure what the cause is. Caught the error using the catch node. As a workaround I added an extra minute delay once a 403 is caught and that usually solves the issue after a retry or 2.

I've unchecked "check server certificate is valid" because the error mentions TLS, but that did not work.

It does not seem to affect text-only emails, rather only emails with attachments, but I'm not sure because of the intermittent nature.

These emails use an attachment specified like this:

```auto
[{"href":"https://drive.google.com/uc?export=download&id=abcd","filename":"filename.pdf"}]

```

Error:

```auto
{"message":"Error: Invalid status code 403","source":{"id":"28531485.20474c","type":"e-mail","name":"","count":1},"stack":"Error: Invalid status code 403\n at ClientRequest.<anonymous> (/home/admin/.node-red/node_modules/node-red-node-email/node_modules/nodemailer/lib/fetch/index.js:213:23)\n at ClientRequest.emit (events.js:400:28)\n at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:647:27)\n at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)\n at TLSSocket.socketOnData (_http_client.js:515:22)\n at TLSSocket.emit (events.js:400:28)\n at addChunk (internal/streams/readable.js:293:12)\n at readableAddChunk (internal/streams/readable.js:267:9)\n at TLSSocket.Readable.push (internal/streams/readable.js:206:10)\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)"}

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 March 2022 14:42 UTC](https://discourse.nodered.org/t/intermittent-error-403-with-email-node/60324/2 "2022-03-25T14:42:15Z")

</div>

I don't know what might be causing the problem for you, but you might be interested in [this flow](https://flows.nodered.org/flow/05e6d61f14ef6af763ec4cfd1049ab61) which provides guaranteed delivery, with queuing of requests and retries till it works.

---

<div class="post-metadata">

**Author:** ![Ashfaak](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ashfaak/32/34409_2.png) [@Ashfaak](https://discourse.nodered.org/u/Ashfaak)\
**Post date:** [6 April 2022 09:58 UTC](https://discourse.nodered.org/t/intermittent-error-403-with-email-node/60324/3 "2022-04-06T09:58:40Z")

</div>

Thanks Colin. I will implement this.

I got a 404 as well. It seems to have been caused by an error on the mail server side.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 June 2022 09:59 UTC](https://discourse.nodered.org/t/intermittent-error-403-with-email-node/60324/4 "2022-06-05T09:59:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
