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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Suggested answer

Email Parameters

(0) ShareShare
ReportReport
Posted on by 2,426

Good Morning,

I am trying to setup email parameters 

As,our admin has already created SMTP server and he gave all details in email parameters in ax

Now i want to test that email parameters are working or not.

Is there any validation or any job code to  know whether the email parameters are correct are not.

Please provide any help.

Any help would be greatly appreciated.

Best Regards.

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,166 Super User 2025 Season 2 on at
    RE: Email Parameters

    Hi,

    What are you exactly trying to email? Is it about alerts to employees or invoices to customers? Did you check if the email processing job is running in batch?

  • Suggested answer
    Pravasti AK Profile Picture
    2,985 on at
    RE: Email Parameters

    Hi,

    Below is  a code to check multiple email addresses;

    public static container checkEmailValidity(container emailAddresses)

    {

       str currentEmail;

       container  invalidEmailAddresses;

       Counter emailCounter = 1;

       //check all of the email addresses against the email regular expression

       while (emailCounter <= conLen(emailAddresses))

       {

           //read the current email address from the container

           currentEmail = conPeek(emailAddresses, emailCounter);

           //check to see if the email is invalid and if it is then add it to the list

           if(!this.isValidEmail(currentEmail) && currentEmail !="")

           {

              invalidEmailAddresses += currentEmail;

           }

           ++emailCounter;

       }

       return invalidEmailAddresses;

    }

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Email Parameters

    Good Morning Andre,

    Hope you are fine.

    It is about alerts to customers.

    Yes email processing job is running

    But i want to know whether the email parameters are right or wrong

    Email_5F00_Sending_5F00_Status.png

    Batch_5F00_Class.png

    i am trying to add in confirmation level and tested the code is

    SalesTableListpage --> Confirmation Button

    Batch_5F00_Code.png

    After Confirmation,As i am seeing in Email sending Status Form

    it is showing failed

    Email_5F00_Sending_5F00_Status.png

    So,please guide me what i have done wrong

    Regards.

    Have a great day Andre.

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Email Parameters

    Hi Kavitha rajan,

    Hope you are fine.

    i want to validate whether the outmail server which is entered in email parameters is working or not fom ax

    Regards.

    Thanks.

  • Suggested answer
    Pravasti AK Profile Picture
    2,985 on at
  • André Arnaud de Calavon Profile Picture
    300,166 Super User 2025 Season 2 on at
    RE: Email Parameters

    Hi AX 2012 R3,

    You can try a job to test SMTP settings:

    static void testSMTP(Args _args)
    {
        SMTP    smtp = new SMTP();
        
        smtp.fromAddr('noreply@dynamics.ax');
        smtp.fromName('Dynamics AX');
        smtp.to('your@mail.address');
        smtp.subject('Test email from Dynamics AX');
        smtp.htmlBody('<html><p>Generated test mail from Dynamics AX.</p></html>');
    
        smtp.initFromParameter();
        smtp.send();
    }


    Have you also tried to look at error logs in the Batch history and/or Windows event logs on the AOS and Mail server?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: Email Parameters

    You have to provide a valid e-mail address for the AX User account in the Tools>Options menu. The e-mail sending code pulls the e-mail address from there by default, and the SMTP server will reject e-mails if it does not contain a valid entry associated with your domain/exchange server as From address. You may go around this limitation with custom X++ code like André has pasted it above to test the SMTP server, but you still need to provide valid data in the code.

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Email Parameters

    Hi Andre,

    Hope you are fine.

    i did a try   but there is no SMTP

    Please find the below attachment

    No_5F00_SMtp.png

    Please Suggest me.

    Regards.

  • AX 2012 r3 Profile Picture
    2,426 on at
    RE: Email Parameters

    Hi Vilmos,

    Hope you are fine,

    After sales order confirmation .Sales confirmation report will open

    Then at that moment i want to send mail to that particular customer regarding salesorder confirmation details.

    Is it possible ?

    if yes please suggest me some steps.

    Please help.

    Have a great day

  • André Arnaud de Calavon Profile Picture
    300,166 Super User 2025 Season 2 on at
    RE: Email Parameters

    Hi AX2012R3,

    My bad... Use SysMailer class instead of SMTP. Some methods are named a bit different in this class or doesn't exist at all.

    I had another custom solution using another class.

    kind regards,

    André

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Willem van Duren Profile Picture

Willem van Duren 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans