Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)
Suggested answer

Email Parameters

(0) ShareShare
ReportReport
Posted on by 2,420

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

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

    When a sales confirmation is posted, a new CustConfirmJour journal entry is created in that table. So you can hook up your e-mail sending logic in CustConfirmJour.insert method. Or if it is not working because it is getting generated by doInsert for whatever reason, try putting it in aosValidateInsert which gets fired always (unless explicitly specified).

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 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é

  • AX 2012 r3 Profile Picture
    AX 2012 r3 2,420 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

  • AX 2012 r3 Profile Picture
    AX 2012 r3 2,420 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.

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 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.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 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
    Pravasti AK Profile Picture
    Pravasti AK 2,985 on at
  • AX 2012 r3 Profile Picture
    AX 2012 r3 2,420 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.

  • AX 2012 r3 Profile Picture
    AX 2012 r3 2,420 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.

  • Suggested answer
    Pravasti AK Profile Picture
    Pravasti AK 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;

    }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans