I created Gmail sending from my program.
Basically in different parts of the program, if the user clicks on a button, it sends emails to respective email addresses.
I couldn't reproduce it, but my customers say that after starting the program, it works fine: it sends the emails for about an hour, but then, the emails are not received, nor are they in the Sent folder.
There is no error message.
If they quit the program and start it, it works again.
What can cause this error? Is there a token expiration?
Google access tokens expire after a set period, so it's important to call Connect before interacting with the service if your application remains active for an extended time.
This ensures that a valid access token is available when sending or receiving messages. If your refresh token is still valid, this process will be seamless and won't require any user action.
As you suggested I put the "MyGmailObject.Connect(Nil);" part before the SendMessage (code below), but the problem persists: after a time it doesn't send emails.
Var
MyGmailObject: TTMSFNCCloudGoogleGmail; //This is a global variable
Procedure Something;
Begin
// some other code lines...
MyGmailObject.Connect(Nil);
MyGmailObject.SendMessage(MyGmailMessage);
I wrote my message 5 days ago. Have you had time to read it since then?
My customer keeps calling me daily because the company's invoices and bids are not received by their customers -> as I wrote you : after a time GMail sending stops working.