cduMail.CreateMessage(USERID,recUserTemp."E-Mail",recUserSetup."E-Mail",txtSubject,txtBody,TRUE); cduMail.send; Message('Notification mail have been sent');I have given a wrong mail id which does not exist in my Exchange server and the system is given an error message as
This is fine.Your email meesage was unable to sent because your mail server rejected the message: Client does not have permission to send as this sender
Comments
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I have given an invalid email id to check my code and since the email id is invalid the exchange server has given an error message. this is valid.
my problem is even if the mail is not sent the message that is given below is displaying.
do i have to put sleep command before the message like below
tsv
tsv
I think you should put your code like this..
if Mail Send Succeffully Then
Message('Mail Sent')
else
Message('Error occured')
tsv
So IF there is an error that is detectable, it should be fired.
Maybe you are using an older or customized version ? If not, then you are having an error that is not reported back to NAV, and you are out of luck.
I tried to put the message box to see the valule of "Result" varaible like below
It returned a blank message box...
tsv