Author Topic: Nano 10 Email  (Read 11360 times)

mullacott

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Nano 10 Email
« on: November 28, 2011, 01:25:08 PM »
I am having a problem getting a Nano 10 to send out an email. I have a Nano 10 connected to a few MODBUS power sensors and a Weintek touch screen over MODBUS. The PLC is connected to a router and there is no pc on the system so I canot use TLserver. I have used the worked example ?
 SEND AUTHENTICATED EMAILS DIRECTLY FROM THE PLC USING TCPCONNECT?. I get a fail message back. I think the problem is my isp is blocking emails coming in on their port 25 and 587. I have tried telnet ?username? and the reply says can not open host on port 25. Is there anyone who has got this to work with their isp and if so who are they using. Or is there a clever work around.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Nano 10 Email
« Reply #1 on: November 28, 2011, 10:00:21 PM »
What SMTP server port do you use when you send email from your PC? You can check your email client settings to have an idea. The method described can work with ISP that requires authentication but not encryption. The PLC does not handle encryption.

You can try TLServer to see if you are able to send a test message from TLServer "Setup Emails" screen.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mullacott

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Nano 10 Email
« Reply #2 on: November 28, 2011, 10:30:24 PM »
Thanks for your quick response. I am with freeserve which is now orange. I use port 25 with outlook on my pc. On the pc I uses <domain name>.freeserve.co.uk@fs if I use telnet it response that it fails but if I uses smtp.freeserve.com I get an ip of 193.252.140:25. When I put this ip with no authentication used into TLserver it works 3 out of 4 times but only to the freeserve email address (I can live with that because this address could forward it).

The first part of the code is:
A$_SMTP_Server =  "193.252.22.140:25"
B$_Send_Email = "FName LName <simon@martinslade.freeserve.co.uk
C$_Receive_Email = "FName LName <simon@martinslade.freeserve.co.uk
D$_Subject = "Test Email Subject"
E$_Domain = "martinslade.freeserve.co.uk"
     
V$ = ""                                                   
W$ = "martinslade.freeserve.co.uk"
X$ = "XXXXXXXX"

F$_Body_Line1 = "Test Email line1"
G$_Body_Line2 = "Test Email line2"
H$_Body_Line3 = "Test Email line3"
I$_Body_Line4 = "Test Email line4"



IF Z > 16                                              .
 Z = 16
ENDIF

CLRIO EMAIL_SENT
CLRIO EMAIL_FAILED

CALL TCP_Email

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Nano 10 Email
« Reply #3 on: November 29, 2011, 02:47:48 PM »
If you are able to send unauthenticated email from TLServer it suggests to me that the simple PRINT #4 "<EMAIL>  xxxxx" command should work. Yet you said you are unable to telnet to the SMTP server Ip address, so it is a bit confusing here.

If you go to command prompt of your PC and enter:

C:\> telnet 193.252.22.140 25  

Do you get a connection to the server? If the connection is successful the command prompt screen will go blank and you will be put at the first column and first row of the screen. Otherwise Windows will report "Connecting to 192.252.22.150...Could not open connection to the host".

If you are able to successfully connect to the host from a PC on the same network then you should be able to use the <EMAIL> tag to send out the email. I am assuming that the PLC and the PC are connected to the same router and are at the same level for this test to be meaningful. The router must be connected to the Internet provided by freeserve.co.uk.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mullacott

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:Nano 10 Email
« Reply #4 on: November 29, 2011, 11:11:44 PM »
I have spent a long time working on the problem now knowing that I should be able to get the email to work. I found in the worked example, that I have to remove the error checking part and increase the time delay by 10 fold between each PRINT#4 commands. Also I was using register Z elsewhere in my code (the main problem). So now the email works.
Thanks again for all your help it is great to know there is such good help for such a great little PLC.