Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

continuing email program problems...


ekahler Dec 21, 2015 11:33 PM

I switched to Yahoo per the thread below about Gmail not working anymore, but I'm not able to get the email function to work.  I called CS to try to walk through potential issues, and I was told that if the "get variables" command I used was working properly, I should be able to see the data from the remote datalogger when connected to the main datalogger.  The variable names do show up in the appropriate table, but the values are not correct - level_ft for the 206 is given as 0 when it reads NAN by the 206 (it's not connected), Result22 = -16, and Result = "error: failed to connect"

You can the relevant sections of code below, I think the problem is still with my program rather than the email end of things, but I don't know what to do now.  Any help or leads would be appreciated - otherwise I will just have to keep calling and trying to figure it out over the phone - not very efficient when the problem is probably far easier to spot with the text of the program.

Const ServerAddr="smtp.yahoo.com:25"
Const ToAddr="ekahler@usgs.gov"
Const ToAddr2="ekahler@usgs.gov"
Const FromAddr="sancarlos122@yahoo.com"
Const Subject="FROM SC1"
Const Attach=""
Const UserName="sancarlos122@yahoo.com"
Const Password="xx"
Const CRLF = CHR(13)+CHR(10)

Public Result As String * 50
Dim Message As String * 250
Dim EmailSuccess As Boolean
Dim Email_Attempts As Long
Dim EmailResult As String * 50

'get variables from 206
  GetVariables(RFResult122,ComSDC7,0,22,0000,0,"Public","CS450(1)",Lvl_ft,1)

If TimeIntoInterval (600,630,min)
      Message = "SC1 level is " +Round(Lvl_ft,1)  + " ft" + CRLF
      Message = Message + "SC22 level is" +Round(Lvl_ft,1)  + "ft" +CRLF
      Do
        EmailSuccess=EmailSend (ServerAddr,ToAddr2,FromAddr,"from SC1",Message,Attach,UserName,Password,Result)
        Delay (0,5,Sec)
        Email_Attempts = Email_Attempts + 1
        If Email_Attempts = 10 Then ExitDo
      Loop Until EmailSuccess = True
    EndIf


GaryTRoberts Dec 22, 2015 05:06 AM

try Const ServerAddr="smtp.mail.yahoo.com:465" for the email issue.  As for the -16 result on GetVariables, there might be more missing than is listed here.

Shoot me an email at gtroberts -at- campbellsci.com and I will help you get going.

Log in or register to post/reply in the forum.