Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: mhw on July 27, 2023, 12:20:56 PM

Title: SMTP EMAIL Errors
Post by: mhw on July 27, 2023, 12:20:56 PM
No I did not notice the (?) mark. (degrees) it is.

Now I have a different problem. I have the program running in the SIM and have successfully sent several emails this morning. Now it is telling me that it is failing with the following response "Unexpected response from SMPT server in EMAIL". I have not changed anything other than the message. I can send and receive emails using that server on my computer. Any ideas?
Title: Re: SMTP EMAIL Errors
Post by: franji1 on July 27, 2023, 01:31:16 PM
Turn on email debugging for DmLogger.  Look at the Help topic for EMAIL (topic ID DMD068) and then look for the section on DmLogger

The easiest way to debug EMail is
1. go to the EMAIL instruction in your program.
2. float your cursor over the wrench in the top right corner of the EMAIL instruction in the ladder view (the wrench is context sensitive tools that is instruction/instance specific)
3. In the menu, select Enable PLC Message Dump (should be the top entry in the tool context menu)
4. You want to turn ON ST36 to Enable Message Dump (per the Help topic mentioned above)
5. Make sure the Message Level is set to 1 (0 won't log anything, 2 is too too much - only useful to see details, but this bogs down the PLC, your network, your PC; the default Message Level is 1).
Title: Re: SMTP EMAIL Errors
Post by: mhw on July 27, 2023, 02:22:30 PM
Thanks, please help me understand what this means.
Title: Re: SMTP EMAIL Errors
Post by: franji1 on July 27, 2023, 02:25:25 PM
Try turning up the Message level to 2 to see if you get more details (remember to turn it back to 1 after you get a new log)
Title: Re: SMTP EMAIL Errors
Post by: mhw on July 27, 2023, 02:40:25 PM
Please see attached.
Thank you.
Title: Re: SMTP EMAIL Errors
Post by: franji1 on July 27, 2023, 02:52:16 PM
It was in the first post - error 451.

See this article https://en.wikipedia.org/wiki/List_of_SMTP_server_return_codes

You may be spamming it?  If your logic is a little off - you can easily spam your email recipient.  You need to contact the receiver to see what can be done to convince them you are not a spammer.  Actually, just ask them why you might be getting an error 451 from them.

Don't forget to reset the log level back to 1.
Title: Re: SMTP EMAIL Errors
Post by: franji1 on July 27, 2023, 03:01:04 PM
You might just want to google SMTP error 451
Title: Re: SMTP EMAIL Errors
Post by: franji1 on July 27, 2023, 05:14:21 PM
Duh!  I looked at the link in the error 451 and it spells it out there.  The link in the error message tells you that you cannot have "bare LFs".  Read that page and hopefully it will tell you how to format your EMAIL script to get blank lines in your content.

Possibly just replace "$N" or "$0D$0A" in your EMAIL text script  with "\r\n"? ? ?
Title: Re: SMTP EMAIL Errors
Post by: mhw on July 28, 2023, 07:07:10 AM
Thanks for your help and persistence!
It is working again.
Title: Re: SMTP EMAIL Errors
Post by: franji1 on July 28, 2023, 07:45:36 AM
Thanks for your help and persistence!
It is working again.

Don't thank me - I had no clue - I was amazed that everything was spelled out - I was just the messenger.
Title: Re: SMTP EMAIL Errors
Post by: pbw on July 28, 2023, 09:49:02 AM
No I did not notice the (?) mark. (degrees) it is.

Now I have a different problem. I have the program running in the SIM and have successfully sent several emails this morning. Now it is telling me that it is failing with the following response "Unexpected response from SMPT server in EMAIL". I have not changed anything other than the message. I can send and receive emails using that server on my computer. Any ideas?
Another option, would be to use the *....86*F....maybe