Android Question Problem Sending Email

Marcelo Herrera

Member
Licensed User
Longtime User
Hi, I've been trying to create an app that takes a screenshot and sends an email with it attached. When I click send i seems not to do anything, even though I have a message of "message was not sent", which is not showing and the message is not sending. Does anyone have a suggestion?

here is my code.

Sub Send_Click

Dim result As Int

Msgbox2("You are about to send an email to My@email.com. Are you sure you want to do this?", "Attention","Yes","","No",Null)

If result = DialogResponse.positive Then

SMTP.Initialize("mail.server.com",25, "my@email.com", "xxxx", "SMTP")
SMTP.To.Add("my@email.com")
SMTP.Subject = "Subject Line"
SMTP.Body = Name.Text AND Company.Text AND PhoneNum.Text AND Email.Text AND AddInfo.Text
SMTP.AddAttachment(File.DirRootExternal, "Image.png")
SMTP.Send

Else If result = DialogResponse.NEGATIVE Then
Return
End If

End Sub
Sub SMTP_MessageSent(Success As Boolean)
Log(Success)
If Success Then
ToastMessageShow("Message sent successfully", True)
Else
ToastMessageShow("Error sending message", True)
Log(LastException.Message)
End If
End Sub
 

Marcelo Herrera

Member
Licensed User
Longtime User
Erel,

It seems that the msgbox2 with the if statment was the problem. I changed the if statement with a "select case" and it it worked fine. There was no message in the logs. Thanks for responding
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…