'build code to send email
'to send email via gmail, you need to set less secure apps on https://myaccount.google.com/
Sub BuildSendEmail(fromEmail As String, toEmail As String, ccEmail As String, subject As String, message As String) As Map
message = message.replace(CRLF,"|")
Dim Se As Map = CreateMap()
Se.put("from", fromEmail)
Se.put("to", toEmail)
Se.put("cc", ccEmail)
Se.put("subject", subject)
Se.put("msg", message)
Return Se
End Sub
'send an email
'to send email via gmail, you need to set less secure apps on https://myaccount.google.com
'1. Click Security
'<code>
''send an email
'to send email via gmail, you need to set less secure apps on https://myaccount.google.com
'Dim bOK As Boolean = BANano.Await(SendEmailWait("[email protected]", "[email protected]", "[email protected]", "Test Email", "Have you received this||..."))
'</code>
Sub SendEmailWait(fromEmail As String, toEmail As String, ccEmail As String, subject As String, message As String) As Boolean
Dim res As String = BANano.CallInlinePHPWait("SendEmail", BuildSendEmail(fromEmail, toEmail, ccEmail, subject, message)) 'ignore
Dim result As Map = BANano.FromJson(res)
Dim sstatus As String = result.Get("status")
c If sstatus = "success" Then
Return True
Else
Return False
End If
End Sub