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.

Send email using gmail RelayEmail

quiqueapolo Jun 30, 2017 06:58 AM


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"

Scan (10,Sec,3,0)
PanelTemp (PTemp,_60Hz)


Subject = ""
Message = "Message"
EmailResult = EmailRelay(ToAddr, Subject, Message, ServRes,0,1,Min,8)


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

GaryTRoberts Jul 11, 2017 07:20 PM

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.

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