I followed all the instructions on the CampbellSci Airlink LS manual for sending an email but it does not work. I am trying to send message every 5 minutes- just to test.
'Declare Public Variables
Public PTemp, batt_volt
Dim Message As String * 250
Public EmailServerResp As String * 50
Public EmailResult
'Declare Constants
'Email parameter strings (as constants), Message String & Result Variable
Const ServerAddr="smtp.gmail.com:587"
Const ToAddr="email@yahoo.com"
Const FromAddr="some@gmail.com"
Const Subject="Email Test"
Const Attach=""
Const UserName="dos.santosmn@gmail.com"
Const Password="xxxxxx"
Const CRLF = CHR(13) & CHR(10)
'Defined some Data Tables
'Main Program
BeginProg
Scan (1,Sec,0,0)
PanelTemp(PTemp,250)
Battery (batt_volt)
If IfTime(0,5,Min) Then
Message = "Hello Sergio!!"
EmailResult = EmailSend(ServerAddr,ToAddr,FromAddr,Subject,Message,Attach,UserName,Password,EmailServerResp)
CallTable EmailLog
EndIf
'Call Output Tables
CallTable Test
NextScan
EndProg
======================================================
NO MESSAGES ARE ACTUALLY SENT! but ..
I get the following result for EmailSend saved to an EmailLog table
"TOA5","CR1000_PB100","CR1000","16395","CR1000.Std.27.04","CPU:SendEmail.CR1","20040","EmailLog"
"TIMESTAMP","RECORD","EmailResult","EmailServerResp","Message"
"TS","RN","","",""
"","","Smp","Smp","Smp"
"2015-12-11 15:55:00",0,0,"220 2.0.0 Ready to start TLS ","Hello Sergio!!"
"2015-12-11 16:00:00",1,0,"220 2.0.0 Ready to start TLS ","Hello Sergio!!"
"2015-12-11 16:05:00",2,0,"220 2.0.0 Ready to start TLS ","Hello Sergio!!"
"2015-12-11 16:10:00",3,0,"220 2.0.0 Ready to start TLS ","Hello Sergio!!"
"2015-12-11 16:15:00",4,0,"220 2.0.0 Ready to start TLS ","Hello Sergio!!"
"2015-12-11 16:20:00",5,0,"220 2.0.0 Ready to start TLS ","Hello Sergio!!"
This issue has already been brought up recently. Gmail changed the timeout for TLS connections on their servers. The CR6 can use Gmail, but the CR1000 not times out during authentication.
Some other email services are suggested in this post:
https://www.campbellsci.com/forum/messages.cfm?threadid=D3DE5628-9592-41F2-99E39F4CB1B35173