News:

  • September 22, 2026, 08:06:05 AM

Login with username, password and session length

Author Topic: SMTP EMAIL Errors  (Read 15182 times)

mhw

  • Hero Member
  • *****
  • Posts: 250
SMTP EMAIL Errors
« 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?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: SMTP EMAIL Errors
« Reply #1 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).

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: SMTP EMAIL Errors
« Reply #2 on: July 27, 2023, 02:22:30 PM »
Thanks, please help me understand what this means.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: SMTP EMAIL Errors
« Reply #3 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)

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: SMTP EMAIL Errors
« Reply #4 on: July 27, 2023, 02:40:25 PM »
Please see attached.
Thank you.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: SMTP EMAIL Errors
« Reply #5 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.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: SMTP EMAIL Errors
« Reply #6 on: July 27, 2023, 03:01:04 PM »
You might just want to google SMTP error 451

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: SMTP EMAIL Errors
« Reply #7 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"? ? ?

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: SMTP EMAIL Errors
« Reply #8 on: July 28, 2023, 07:07:10 AM »
Thanks for your help and persistence!
It is working again.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: SMTP EMAIL Errors
« Reply #9 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.

pbw

  • Hero Member
  • *****
  • Posts: 127
Re: SMTP EMAIL Errors
« Reply #10 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