Android Question SMTP ErrorSMTP-

gragey

Member
Licensed User
Longtime User
Hello
Since today I have the error :
java.lang.RuntimeException: Error sending message: 550 5.0.0 message does not have exactly one Date field
when i send a message whith the SMTP free
My application have no modifications for 5 years ...
Do you have an idea ?
Thanks
 

gragey

Member
Licensed User
Longtime User
Thank you Erel for your response.
My application was OK for 5 years until 01/08/2025

The code is :
Sub SendMessage (SMTP As SMTP, Ademail As String, Corpsmail As String)
SMTP.Initialize("smtp.free.fr", 465, "***************@free.fr", "**********", "SMTP")
SMTP.UseSSL = True
SMTP.To.Add(Ademail)
SMTP.CC.Add("****************@gmail.com")
SMTP.Subject = "Facture"
SMTP.Body = Corpsmail
SMTP.AddAttachment(File.DirRootExternal , "Facture.pdf")
ToastMessageShow("Envoi de la facture en cours", True)
SMTP.Send
End Sub

Sub SMTP_MessageSent(Success As Boolean)
If Success=True Then
ToastMessageShow("Email transmis", True)
Timer1.Enabled = True
Else
ToastMessageShow("Email non transmis", True)
Log(LastException.Message)
End If
End Sub


Now : java.lang.RuntimeException: Error sending message: 550 5.0.0 message does not have exactly one Date field

I have the last version of Net Library
If you have an idea perhaps to change the smtp server for a test ?
Thank you
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
Whenever you see code with File.DirDefaultExternal or File.DirRootExternal you immediately know that it is broken code.
That was written by Erel in 2022.
My application was OK for 5 years until 01/08/2025
That is probably the root of your problem - it is time to update it. Start by using XUI.DefautlFolder but be prepared for other changes.
 
Upvote 0

gragey

Member
Licensed User
Longtime User
Thanks Erel
I will update my application.
Sorry but I think there must be another explanation for this problem because when I don't attach any files I still have the same error ...

Thank you
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
. . . there must be another explanation for this problem . . .
Yes, that is probably true. Your post suggests that you have not changed your app for five years, but in that time Google has introduced two-step verification, for example. You don't make it clear in your post if that affects your usage case.
 
Upvote 0

gragey

Member
Licensed User
Longtime User
I think that the modification is on the Free SMTP server.
I choose another professional SMTP server (BREVO) with the port 587 and I modify the code with :
SMTP.StartTLSMode = True
instead of :
SMTP.UseSSL = True
and now it's OK
Thank you for your help.
 
Upvote 0
Top