Email not sent thru NAS

I have a Navision table which holds the email messages ready to be sent. i created a report to loop thru these email entries and use CU Mail.NewMessage to send them out one by one. When a user manually runs the report, everything get sent.

When the report is called (as a Job Queue Entry) thru NAS, the mail is not send.

We’ve tried to create a email account for NAS logon with the same setup as the user email account profile but to no avail. Could anyone help? Many thanks.

Are you using codeunit 397 (Mail) or 400 (SMTP Mail)? With NAS, you’ll want to be using codeunit 400.

Thanks for replying.

i was using CU 400 before, but since user has SMTP mail sent problem (error 0x80040213) The transport failed to connect to the server (my other forum post) - we know it’s not firewall/proxy, but even just normal approval email sent encounters the same error …(user has tried specifying SMTP server IP address on SMTP setup). If you could shed some light on this, that would be much appreciated.

Anyway, that’s the reason I switched to CU Mail since user can manully run the send email report (which is created for Job Queue entry) without issues … but got stuck at NAS when report is processed thru Job Queue entry by NAS).

Hope I’m explaining things clear enough. Thank you again for your time.

The transport error seems to indicate a couple possibilities. 1) the message is not reaching the SMTP server or 2) the SMTP server is rejecting the message.

Possible causes?

  1. The SMTP server is not on port 25

  2. The SMTP server does not allow anonymous senders and it does not recognize your “from address”

I’ll try those that you suggested and will keep you posted. thank you again for your time and help.


I ran into this issue a few years back when I was doing this for a client. The client was using Exchange. It turned out that Exchange would not validate a “sending” address thru SMTP until it had sent mail thri Exchange. I installed Outlook Express and send an email. Then my SMTP worked fine.

I don’t know if this was unique to their setup or a general Exchange behavior. Thought I’d pass it along.

Sorry for the late response: the client decided to use SMTP instead … and after a long while they came back to me and said they figured out it was a firewall issue as you’d suggested … i apologized for giving the wrong info in the beginning saying “it’s not a firewall issue”.