Server Error 500 when trying to send email

I'm still working on the registration system tutorials from @Hyperbytes and have encountered a server 500 error when trying to send the validation code. I followed the steps mentioned here: Debugging Server Connect Errors (I think) and here's the (hopefully) more helpful errors I'm getting.

POST http://localhost:3000/api/UserAction/register 500 (Internal Server Error)
_send @ serverconnectForm.js:280
_formSubmit @ serverconnectForm.js:185
_submit @ form.js:63
_submitHandler @ form.js:45

If I click on serverconnectForm.js:280 it shows this section of code:

try {
this._xhr.send(data);
} catch (err) {
this._done(err);
}
},

this._xhr.send(data); has a red circle with an x in it.

I don’t think sending email from a local host server will work. At least it never had for me. I always have to test send mail on live server.

1 Like

You're looking in the console tab, you need to look in the network tab

1 Like

I'm using my web server to actually send the mail. Or do you mean it won't work unless the entire site is hosted remotely? I think it's hosted locally in the tutorial.

Please follow this guide to see the exact error:

1 Like

Here's the info from the network tab.

; regCode status 200 type xhr initiator fetch.js:338 size 285 B 8ms
x register status 500 xhr serverconnectForm.js:280 size 594 B 680ms

Almost there, still not that :slight_smile:

Inside the network tab, try to find somewhere it says "Response"

1 Like

I did follow that guide, and got the info posted above in either the initial message or the replies. There might be something I missed, but I've gone through it twice now.

Click on this line in the network tab and it will show more details under response ...

1 Like

{
"status": "500",
"code": "ESOCKET",
"message": "13783936:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:..\..\third_party\boringssl\src\ssl\tls_record.cc:231:\n",
"stack": "Error: 13783936:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:..\..\third_party\boringssl\src\ssl\tls_record.cc:231:\n"
}

Thanks for pointing that out. I was having trouble finding "Response" mentioned by @Apple!

What is the mail server you are using here? How's the mailer set up under globals?

I'm using my webhost and website domain.

Are you sure you configured the settings correctly - i.e the port and use ssl option? Please double check this with your host docs.

1 Like

|Username|Your email address: john@example.com| - I copied and pasted this. Double checked for extra spaces.

|Password|The password for that email account.| - Copied and pasted, double checked for spaces.

|Incoming Server|imap.oxcs.bluehost.com| - I'm not using this, since I'm sending mail.

|Incoming Port|993 (IMAP)| - Or this.

|Outgoing Server|smtp.oxcs.bluehost.com| - Copied and pasted, checked for extra spaces.

|Outgoing Port|587 (SMTP)| - Copied and pasted, checked for extra spaces.

|Authentication|Password| - I'm not sure why this is listed twice.

Could there be an issue with special characters in the password? Mine contains ! and $ currently.

Try unchecking the Use SSL option and save the mailer setup, then test sending an email again.

1 Like

Settings look ok according to bluehost

1 Like

I did, same result.

I found a port 465 recommendation as well, also tested it.

I just saw that if you don't use SSL it says to use port 26, so I'll try that.

Swapping it to the without SSL settings - mail.example.com and port 26 seems to have fixed some of it. Now it says "Failed to load response data: No resource with given identifire found." That sounds like something named incorrectly in register.json or register.ejs, right?

On another note, is there a way to generate dummy emails for testing purposes?