Mailpro returning last response string

Questions and answers on developing, deploying and using plugins and JavaBeans

Mailpro returning last response string

Postby andre1506345542 » Tue Dec 24, 2019 9:41 am

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
andre1506345542
 
Posts: 39
Joined: Mon Sep 25, 2017 3:19 pm

Re: Mailpro returning last response string

Postby patrick » Tue Dec 24, 2019 11:01 am

What would you do with that?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Mailpro returning last response string

Postby andre1506345542 » Tue Dec 24, 2019 11:12 am

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
andre1506345542
 
Posts: 39
Joined: Mon Sep 25, 2017 3:19 pm

Re: Mailpro returning last response string

Postby patrick » Tue Dec 24, 2019 1:10 pm

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Mailpro returning last response string

Postby andre1506345542 » Tue Dec 24, 2019 1:53 pm

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
andre1506345542
 
Posts: 39
Joined: Mon Sep 25, 2017 3:19 pm

Re: Mailpro returning last response string

Postby patrick » Tue Dec 24, 2019 4:21 pm

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Mailpro returning last response string

Postby andre1506345542 » Tue Dec 24, 2019 4:49 pm

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.
andre1506345542
 
Posts: 39
Joined: Mon Sep 25, 2017 3:19 pm

Re: Mailpro returning last response string

Postby patrick » Tue Jan 07, 2020 11:31 am

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3692
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Mailpro returning last response string

Postby andre1506345542 » Tue Jan 07, 2020 1:34 pm

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
andre1506345542
 
Posts: 39
Joined: Mon Sep 25, 2017 3:19 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 6 guests

cron