Hi
The function sendMessage() only returns true or false. Is it possible to also get the last response string the smtp server sends to you.
Something like
250 Ok: queued as S104iUcGRTmA7QTgon_6jw
Thanks in advance
Andre
Hi
The function sendMessage() only returns true or false. Is it possible to also get the last response string the smtp server sends to you.
Something like
250 Ok: queued as S104iUcGRTmA7QTgon_6jw
Thanks in advance
Andre
What would you do with that?
Hi Patrick
In this response the smtp server mentions a message id number. This number I need to process webhook calls from this smtp server.
During and after the communication the smtp server calls my webservice to notify me with the status of the email message. And it mentions the message id number.
So if I get have this response I know the number and I can process the calls.
Thanks
Andre
The message object that you pass to the send command contains the message ID after it has been sent. So just take it from the message itself.
Thanks Patrick,
But that is not the message id I am looking for. The SMTP server creates its own message id. And this message id, return back to the client in the last response 250 OK:
Brdgs
Andre
As far as I understand, in emailing there is only one message ID: the one a sending smtp server generates. And that one you get on the message sent.
I assume you are talking about this one, right?
vNewMessage.messageID
This returns:
-1474300128.3.1577198901776@PC-ANDRE
The server generates this one.
Message ID FhFMbdsMQ62lFe_JmYqiiQ.filterdrecv-p3las1-5bf99c48d-x47nz-21-5E01FA72-3C.0
So the last response of the smtp server would be
250 Ok: queued as FhFMbdsMQ62lFe_JmYqiiQ
FYI: I use SendGrid for sending emails.
The first one is generated by JavaMail and that seems to be overridden by the mail server. That I think should not be done by a mail server. It makes it really hard to track messages if you can’t rely on their ID. I guess I could add some SMTPAccount.getLastServerResponse(), but it seems that it just works for you by chance with this specific Mail server.
Hi Patrick,
I agree it is a strange way of doing stuff. If I do not have their message id I cannot trace the replies from their webhooks.
It would help a lot if I could have the last 250 OK string back. Then I can trace my emails.
So if you could do this, that would be very appreciated.
Andre