web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Sending mail with SMTP from task scheduler

(0) ShareShare
ReportReport
Posted on by 225

Hi everyone,

I've created a function that send an unknown number of mails to customers. What I've seen, is that yesterday, I need to send 20 mails, and only 15 were sent. The last 5 haven't been sent. When the task ends, we should also send a mail with the summary of the sent mails, but it hasn't been sent either. Does the SMTP have any typ of limitation?

Thank you very much

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Hannes Holst Profile Picture
    5,767 on at

    Hi,

    Maybe your Mail-server has a limitation.

    Include an error-handling to see if you receive an error back.

    Maybe your NAV did send 20 mails, but the SMTP-server only accepted 15 and refused the remaining 5.

    It may happen sometimes due to security reasons, spam etc.

  • jgaztanaga Profile Picture
    225 on at

    Really appreciate your answe. I control the errors this way:

    MailSent := mailSMTP.TrySend;
        IF NOT MailSent  THEN BEGIN
          lShipmentHeader."Notification failed" := TRUE;
          lShipmentHeader.MODIFY;
        END;


    After the execution, I can see that no ShipmentHeader."Notification failed" is marked, so I can assume that NAV has generated the mails correctly...

    Looks like an issue with the limitation you are talking about

  • jgaztanaga Profile Picture
    225 on at

    Thanks Hannes.

    Tonight everything worked correctly. I've introduced a SLEEP sentence of 15 second between every e-mail creation, and the error was solved.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans