# SMTP\_CLIENT Problems

**URL:** <https://oscat.discourse.group/t/smtp-client-problems/2041>\
**Category:** oscat.lib fuer CoDeSys 3\
**Created:** [15. März 2016 um 06:22 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041 "2016-03-15T06:22:43Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/oscat/original/1X/2efdfb9c592ff9a666c94dff124ee84fa863dae5.jpeg) [@system](https://oscat.discourse.group/u/system)\
**Post date:** [15. März 2016 um 06:22 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/1 "2016-03-15T06:22:43Z")

</div>

Hi

To start, thanks for the great functions.

I am not able to get the SMTP\_CLIENT working. The client get stuck at “step = 30” where the program is waiting for “rcv\_state = 220”. I cant see where the FB creates a connection with the SMTP server. I would expect to see a “snd\_test = ‘openssl s\_client…’” or something like that before you receive the state = 220.

Where does the connection happen?

Thanks

---

<div class="post-metadata">

**Author:** ![peewit](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@peewit](https://oscat.discourse.group/u/peewit)\
**Post date:** [17. März 2016 um 19:46 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/2 "2016-03-17T19:46:12Z")

</div>

which email account you use?  
one with SSL / TLS encryption

oscat network smtp\_client does not support encryption

> **[Smart-Mail - FreeMail der Extraklasse](https://www.smart-mail.de/)**
>
> Cleveres Free-Mail Postfach - komplett kostenlos und mit vielen Features.

This works even without encryption (and is free)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/oscat/original/1X/2efdfb9c592ff9a666c94dff124ee84fa863dae5.jpeg) [@system](https://oscat.discourse.group/u/system)\
**Post date:** [30. März 2016 um 08:26 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/3 "2016-03-30T08:26:23Z")

</div>

Thanks

I will have a look at it.

Apparently Stunnel will work with Oscat so that I can send to SSL servers.

---

<div class="post-metadata">

**Author:** ![learnetk](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@learnetk](https://oscat.discourse.group/u/learnetk)\
**Post date:** [14. Juni 2016 um 10:53 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/4 "2016-06-14T10:53:14Z")

</div>

Hi Brendang,  
I have the same issue..  
Did u succed with sTunnel…Can you please describe how you did that.

Thanks

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [22. Juni 2016 um 12:26 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/5 "2016-06-22T12:26:02Z")

</div>

Hello!  
I’m trying to run SMTP\_CLIENT on SoMachine with TM241C241 as CPU.  
SMTP\_CLIENT returns an errors:  
ERROR\_T: 1.  
ERROR\_C: 65280.  
I think the problem is in SERVER variable: ‘akuankanvarasto%[smart-mail.de](http://smart-mail.de):aku12354@smtp.smart-mail.de:25’.  
Could anyone check the syntax? Peewit?))  
I neither was able to send an email with the same email-address ([akuankanvarasto@smart-mail.de](mailto:akuankanvarasto@smart-mail.de)) by cmd.exe - see attached pictures.  
But I’m able to send message by cmd.exe with [akuankanvarasto@gmail.com](mailto:akuankanvarasto@gmail.com), which is unfortunately SSL encrypted

[gelöscht durch Administrator]

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [22. Juni 2016 um 12:30 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/6 "2016-06-22T12:30:46Z")

</div>

By the way, Brendang, did you get Stunnel working with OSCAT?

---

<div class="post-metadata">

**Author:** ![peewit](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@peewit](https://oscat.discourse.group/u/peewit)\
**Post date:** [22. Juni 2016 um 14:36 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/7 "2016-06-22T14:36:03Z")

</div>

ERROR\_T: 1. = DNS\_CLIENT (use UDP)  
ERROR\_C: 65280. = 0x0000FF00 = Receive Timeout

the problem has nothing to do with the SMTP .  
probably works no communication

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [23. Juni 2016 um 06:59 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/8 "2016-06-23T06:59:27Z")

</div>

Thank you Peewit!  
I’ll check the communication.

---

<div class="post-metadata">

**Author:** ![learnetk](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@learnetk](https://oscat.discourse.group/u/learnetk)\
**Post date:** [30. Juni 2016 um 07:19 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/9 "2016-06-30T07:19:43Z")

</div>

Hi Ksanteri  
Did u get it working ??

Thanks

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [30. Juni 2016 um 07:36 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/10 "2016-06-30T07:36:59Z")

</div>

Hi learnetk!  
Unfortunately I didn’t.  
It seems to me, as Peewit told, I have a communication problem I am not able to locate. Our local network sees the CPU (it is TM241C241 by Schneider E in my case), but the CPU is not able to connect to DNS server for some reason. I have tried DNS\_CLIENT module, but it returns nothing (no mistakes, no results), like there is no connection to internet at all.((  
I’m waiting the one person from Schneider E, who is now on vacation, for possible help with the communication problem…  
How is it going in your case?

---

<div class="post-metadata">

**Author:** ![learnetk](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@learnetk](https://oscat.discourse.group/u/learnetk)\
**Post date:** [30. Juni 2016 um 12:32 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/11 "2016-06-30T12:32:47Z")

</div>

Hi Ksanteri,  
my case is quite simialar.

If i use the google DNS(8.8.8.8) then i get the same Error Id as you. But if i try using my DNS of my organization its different error Error\_C = 16#0000FF00 and Error\_T = 16#01.

Please do write if u get a breakthrough  
🙂

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [1. Juli 2016 um 04:12 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/12 "2016-07-01T04:12:28Z")

</div>

Interesting, because I have tried our company DNS-server as well. The error was the same. May I have a look at your program? Can you send me a picture?

---

<div class="post-metadata">

**Author:** ![learnetk](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@learnetk](https://oscat.discourse.group/u/learnetk)\
**Post date:** [1. Juli 2016 um 09:15 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/13 "2016-07-01T09:15:13Z")

</div>

here are some of the screenshots with various trials. I also tried out the library with my  
Raspberry Pi at home, i got a different error Error\_T = 5 and Error\_C (i forget the step no but i crossed the Step 30).  
I tried with the same Pi at my office i get the same old error Error\_T = 2 and Error\_C =16#FF000000.

[gelöscht durch Administrator]

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [1. Juli 2016 um 09:24 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/14 "2016-07-01T09:24:02Z")

</div>

Hi learnetk!  
Thank you for the pictures!  
Peewit, what can you say about those errors?  
By the way, learnetk, if I were you, I would change your email account password on something without “%”-mark. It probably could cause SMTP-mistakes I think.

---

<div class="post-metadata">

**Author:** ![learnetk](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@learnetk](https://oscat.discourse.group/u/learnetk)\
**Post date:** [1. Juli 2016 um 10:36 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/15 "2016-07-01T10:36:32Z")

</div>

Hi,  
I changed the password and tried..but the results were the same.

---

<div class="post-metadata">

**Author:** ![Ksanteri](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Ksanteri](https://oscat.discourse.group/u/Ksanteri)\
**Post date:** [29. August 2016 um 05:38 UTC](https://oscat.discourse.group/t/smtp-client-problems/2041/16 "2016-08-29T05:38:16Z")

</div>

> [@learnetk post:15](#):
>
> Hi,  
> I changed the password and tried..but the results were the same.

Hi, Learnetk!  
After a lot of fruitless attempts I gave up with SMTP\_CLIENT and got my system sending mail in other way. In may case this method fits at list.  
I make my CPU saving a new string to the logging file on a sd-card whenever I want to send email. Then I used CPU as a FTP-server and make my computer automatically syncronize files between my computer and the CPU with free ftp-client I downloaded from internet and a simple batch file. Than I again set up a free programm monitoring a folder with logging file from the CPU and sending email if the file was renewed.  
It is a bit hash, but works.
