Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Dummy")
InternalDisk = "sdcard"
ExternalDisk = InternalDisk & "/external_sd"
ESTargetDrive = ExternalDisk
If FirstTime Then
SMTPMsg.Initialize("mail.myserver.com.au", 587, "anaccount", "somepw", "SMTPMsg") ' does not require STARTTLS
End If
End Sub
Sub Button1_Click
SMTPMsg.To.Add("someone@somewhere.com.au") ' add a recipient
SMTPMsg.Subject = "New Email Technique" ' add a subject
SMTPMsg.HtmlBody = True ' Using HTML Body
SMTPMsg.Body = "<P>1, <B>This</B> is in <span style='color:red'>red</span></P>" ' an equals sign
If File.Exists(ESTargetDrive, "TestFile.txt") Then 'add an attachment
Log("Attachment found")
SMTPMsg.AddAttachment(ESTargetDrive, "TestFile.txt")
Else
Log("Attachment not found")
End If
SMTPMsg.Send ' send the message
End Sub
Sub SMTPMsg_MessageSent(Success As Boolean)
Log("Msg Sent is " & Success)
If Success Then
ToastMessageShow("Message sent successfully", True)
Else
ToastMessageShow("Error sending message", True)
Log(LastException.Message)
End If
End Sub