Android Question Why is SMTP send is not working?

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I have these codes
B4X:
Sub Process_Globals
    Dim Sm As SMTP
End Sub

Sub Globals
    Dim P2 As Phone
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    If FirstTime Then
        Sm.Initialize( "smtp.gmail.com", 587, "myemail@gmail.com", "mypass", "SM")
          Sm.StartTLSMode = True
        Sm.UseSSL = True
    End If
  

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub SM_MessageSent(Success As Boolean)
      If(Success) Then
        Msgbox("Ok","")
    Else
        Msgbox("not ok","")
    End If
End Sub
      
      
Sub Button_Click
    Sm.To.Add("target@gmail.com")
    Sm.Subject = "This is a test"
    Sm.Body = P2.GetSettings( "android_id")  
    Sm.Send
End Sub

I got the message Ok, but no email received. (Net ver 1.52, Phone ver 2.20)

Sender email : myemail@gmail.com is a new created gmail account, just for testing.
If I change sender email to my old gmail account, it worked ok.

Am i missing something here?
 
Last edited:
Top