I want to send an email using order RelayEmail() but it does not work.
I used this code:
Public Subject As String * 30
Public Message As String * 250
Public ServRes As String * 100
Const ToAddr As String = "email@example.com"
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 ToAddr ="firstname.lastname@example.org"
Const FromAddr ="email@example.com"
Const Subject ="New Data File"
Const Nombre_FICH = "See new data file attached"
Const UserName ="firstname.lastname@example.org"
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.