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 AX (Archived)

Sending Email using X++ code Dynamics Ax 2012 R3

(0) ShareShare
ReportReport
Posted on by 436

Hi Experts,

Trying to send Email using following X++ code. But Email  message can't be reached to receiver Email Id.

Following this Link given below.

https://community.dynamics.com/ax/b/alirazatechblog/archive/2013/09/22/sending-email-using-x-code-dynamics-ax-2012

Please let me know if any solution for this.

Thanks

Sona Jee

*This post is locked for comments

I have the same question (0)
  • Jie G Profile Picture
    on at

    Hi Sona,

    Would you please let us know what error have you met?

  • A.Prasanna Profile Picture
    8,223 on at

    Specify /reply with Followings

    1.Which Type of Email Server/Service are you using ?

    2.What is the Error massage you are getting

    3.Screenshot of Email Parameter Setup

    4.have you configured SMTP Relay ?

    Thanks & Regards,

    Amith Prasana

  • Sona Jee Profile Picture
    436 on at

    Using SMTP mail server

    I am not getting any Error message, In Info Log "Email Message has been sent"

    0160.parameter.png

    Configured the SMTP .

    Thanks

    Sona Jee

  • Jie G Profile Picture
    on at

    Hi Sona,

    Have you checked the Junk mails?

  • Suggested answer
    guk1964 Profile Picture
    10,888 on at

    Are you doing this in batch?

    In AX 2012, when emailing reports, the class 'SrsReportRunMailer' is executed.

    When you open that class, you'll see the method 'initMailer' decides whether to use SMTP or outlook.

    When mailing in a batch, it uses SMTP, but when emailing at client, it uses Outlook.

    To change the logic to always go with SMTP, comment out the 'if' clause and leave the code which takes SMTP

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    Check whether massages are queued in SMTP mail root , if it is queuing thats mean some thing to do with SMTP .
    Hope this will help.

    Amith Prasanna

  • Verified answer
    Jie G Profile Picture
    on at

    Hi Sona,

    Today I have tested the code in the link, it worked. I also saw the info log "Email Message has been sent". But I received the email in "Junk email" folder.

    Usually this kind of email may be not able to pass the spam filter.

  • Sona Jee Profile Picture
    436 on at

    Hi Ada,

    I am using a gmail account but i didn't received any email in spam folder.

    And messages are queued in SMTP mail root.

    Thanks

    Sona

  • Sona Jee Profile Picture
    436 on at

    Thanks for the help, it worked.

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 AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans