Using the Servoy Mail plug-in with great success but client has reported a problem that when GetMail fails it will not download any further messages because it stops each time on the problem e-mail.
Log reported the problem as 'illegal route-address in string ’ 'undisclosed recipents:;".
Two questions:
1 Does anyone know how to trap and report GetMail errors to the Client
and
2 How can a ‘problem’ email be downloaded/deleted
Problem solved eventually by going back to the FM Mail plug-in, downloading the problem email and deleting it from Server. Obviously I don’t want to encourage this ![Sad :(]()
Thanks in advance
Graham Greensall
Worxinfo Ltd
Are you saying this happens when you use the receiveMail method and you do no further processing on the mail messages that you received?
Or are you by any change calling getRecipientAddresses() on the mail messages that you received? Because if you’re doing the latter, what you can do is putting a try/catch block around this statement:
var recipients = null;
try {
recipients = mailMessage.getRecipientAddresses();
} catch (e) {
// show a dialog, display e.message
}
if (recipients != null) {
// do something
}
This way you can deal with the error.
Sebastiaan
Thanks for the response. Yes I am using msg.getRecipientAddresses() - have included extract from code below.
Will experiment with your code - although problem difficult to reproduce! - my reading is that it will enable me to show a message if RecipientAddress is empty. Is there any way to then delete that specific email from the Server?
var msg = msgs
forms.wx_documents.controller.newRecord(true)
forms.wx_documents.doc_type = ‘Inbox’
forms.wx_documents.doc_date = msg.getSentDate()
forms.wx_documents.email_message = msg
- forms.wx_documents.email_to = msg.getRecipientAddresses()*
- forms.wx_documents.email_from = msg.getFromAddresses()*
[/quote]
Final question: ‘try’ and ‘catch’ are completely new to me - can you point to further documentation.
Regards
Graham Greensall
Worxinfo Ltd
Hi,
I looked a little bit deeper into the matter, and I would love to have the exact log of the problem (the Java exception). I actually don’t think the problem occurs in getRecipientAddresses anymore.
The try/catch thing is useful for many things though, and to get a description of how that works just google on “javascript try catch” and you will find there is a lot of information on it!
Thanks for your interest - emailing copy of the logfile.
Graham Greensall