SmtpSend - Error 32700

Hello, i have the same Error Code.
I tested the Network settings in the company by sending a test Mail via Windows PowerShell and it works.
When using the same settings on the PP65 the Error 32700 from SmtpSend occurs.
Maybe the TLS Version is to old (<1.2), can I check which TLS Version is used on the PP065?

Hi Michael,

I’m moving your post to a new topic to increase visibility.

You can set the TLS version in the SSL Configuration (Configuration View → AccessAndSecurity → TransportLayerSecurity):

For AS 4, you can select either SSL or TLS, but TLS 1.2 is the only option in AS 6.

Error 32700 means that a parameter was invalid, so it may also be something else. A couple things to keep in mind:

  • Your post says you are using SmtpSend. TLS will only be used if you instead use the SmtpsSend function block. This is most likely required; most servers nowadays require a secure connection
  • If your pHost points to a server name (e.g. smtp.gmail.com) rather than an IP address, DNS must be activated. This could explain why it works for you via Windows.

If you’re still having trouble, please post a code snippet as it will allow us to help you better.

3 Likes

Hi Marcus,

Thanks for your reply!
Unfotunaly the Projekt in AS 3.0.90 and there is no option for a DNS Server,…
The Project should not be updated, beacause we would need to install a bigger CF-card at customer site.

->For AS 3.0 i couldn`t find a SmtpsSend Function, maybe i can create a new Mail Account, where a secure connection is not required.
->The DNS Service is active and configured as “Get DNS from DHCP server”

Parameter.Host					:= 'mail.gmx.net';
Parameter.Sender				:= 'example@gmx.de';
Parameter.User					:= 'example@gmx.de';
Parameter.Password			:= '******';

SmtpSend_0.pHost 				:= ADR(Parameter.Host);
SmtpSend_0.pUser 				:= ADR(Parameter.User);  
SmtpSend_0.pPassword 		:= ADR(Parameter.Password); 
SmtpSend_0.pSender 			:= ADR(Parameter.Sender); 
SmtpSend_0.pReceiver 			:= ADR(Parameter.Receiver);  
SmtpSend_0.pSubject 			:= ADR(Parameter.Subject);						
SmtpSend_0.pText 				:= ADR(Parameter.Text);  
SmtpSend_0.port 				:= 587;  

Thanks for the hint with TLS and SmtpsSend!

I haven’t done a lot of work in AS 3.x so hopefully someone will correct me if I’m wrong. But I think you will have a hard time connecting to many mail servers without DNS and SSL. If those features don’t exist in AS 3, upgrading may be your only option to get this working. Here is why:

  • Without DNS, you will need to specify the IP address of the mail server rather than the hostname. However, there is no guarantee that this IP won’t change in the future. Your PLC may be configured to get it’s IP address from a DHCP server, but this does not mean that it will reach out to a DNS server to resolve the hostname of the mail server
  • Many servers nowadays require SSL to connect. GMail is just one example. If you have your own mail server, this of course should be something to configure…but I wouldn’t recommend sacrificing security just to avoid replacing a CFast card

If you make any more discoveries, let us know!

Update, we could change the DNS Server to a fixed Address in the Settings in AS3.09.
A change to the E-Mail Provider Smart Mail is know used, to do the notification of the customers, because SSL/TLS is not Supported with the library AsSmtp → SmtpSend.
Thanks for the information!

1 Like