Hi:
I want to send an email using order RelayEmail() but it does not work.
I used this code:
Public PTemp
Public EmailResult
Public Subject As String * 30
Public Message As String * 250
Public ServRes As String * 100
Const ToAddr As String = "cr1000etsia@hotmail.com"
BeginProg
Scan (10,Sec,3,0)
PanelTemp (PTemp,_60Hz)
NextScan
SlowSequence
Scan(1,sec,1,0)
Subject = ""
Message = "Message"
EmailResult = EmailRelay(ToAddr, Subject, Message, ServRes,0,1,Min,8)
NextScan
but I think I need to configure STMP server similar to this:
Const ServerAddr="smtp.gmail.com:587"
Const ToAddr ="myemail@hotmail.com"
Const FromAddr ="myemail@gmail.com"
Const Subject ="New Data File"
Const Nombre_FICH = "See new data file attached"
Const UserName ="myemail@gmail.com"
Const Password_mail ="mypassword"
Help me please
What does ServRes show when it runs? That should give you a clue as to what the error is. You don't need to setup your own variables with your own smtp server.
Take a look at https://www.campbellsci.com/blog/loops-prevent-unnecessary-skipped-scans and https://www.campbellsci.com/blog/sending-email-from-datalogger for working examples of how to use the EmailRelay() instruction.