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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Mail sending issue

(0) ShareShare
ReportReport
Posted on by

Hi All,

We are having an issue while we try to send an email from Dyanmic AX. I set SMTP address and port. If users have gmail or our local domain account, mail can be sent succesfully. But If users have microsoft accounts  like outlook, hotmail, mail is not being send. What can be problem ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    SMTP server setup issue with relaying is a potential cause.

    Or not having a from e-mail address populated due to missing setup in User Options form, for e-mail address field.

  • Community Member Profile Picture
    on at

    Hi Vilmos,

    I already checked user options. And I entered manually recipent informations (mail address, subject, body etc.). When I test it by entering gmail accounts as recipent address, it works. why can't it sent mail to hotmail accounts.

  • Vilmos Kintera Profile Picture
    46,149 on at

    What mail provider are you using? Ideally it should be your own Exchange or mail server on premises, or an Office365 mail server. It is harder to troubleshoot free mail providers.

  • Community Member Profile Picture
    on at

    Hi Vilmos,

    We have Exchange Server and servers have been added to External Senders group.

  • Community Member Profile Picture
    on at

    Hi All,

    Did the one experience it or Is there someone's idea about reason of that?

  • Ajit Profile Picture
    8,788 on at

    Can you write a job and use sysMailer class and try to send an email from there?

    Just trying to isolate the problem here.

  • Community Member Profile Picture
    on at

    Hi Ajit,

    I did it, still maills are not reaching to recipients.

    Job code is like below.

    public static server void sendMail(RefRecId _RefRecId,FileName _FileName)

    {

     

        sysMailer   sysMailer;

        str body;

        GVHEArchiveTrans GVHEArchiveTrans = GVHEArchiveTrans::findRecId(_RefRecId);

        GVHEArchiveParameters GVHEArchiveParameters = GVHEArchiveParameters::find();

        str 100          EmailAddress;

        CustTable              lvCustTable;

        LogisticsPostalAddress LogisticsPostalAddress;

        LogisticsLocation LogisticsLocation;

        CustInvoiceJour lvCustInvoiceJour;

        InteropPermission InteropPermission;

        ;

     

     

        InteropPermission = new InteropPermission(InteropKind::ComInterop);

        InteropPermission.assert();

        //VTU E-Archive****

        if(GVHEArchiveTrans.CustInvoiceJourRecId)

        {

            lvCustTable = CustTable::find(GVHEArchiveTrans.InvoiceAccount);

            if (lvCustTable.BRI_EArchiveMailAddress)

                EmailAddress = lvCustTable.BRI_EArchiveMailAddress;

            else

            {

                lvCustInvoiceJour = CustInvoiceJour::findRecId(GVHEArchiveTrans.CustInvoiceJourRecId);

                select firstonly LogisticsLocation

                    join LogisticsPostalAddress

                    where LogisticsPostalAddress.Location == LogisticsLocation.RecId

                       && LogisticsPostalAddress.RecId == lvCustInvoiceJour.InvoicePostalAddress;

     

                EmailAddress = LogisticsLocation.BRI_EArchiveMailAddress;

            }

        }

        //VTU E-Archive****

            else

            EmailAddress = VendTable::find(GVHEArchiveTrans.VendAccount).email();

     

     

     

     

        sysMailer = new sysMailer();

     

     

        if(SysEmailParameters::find().SMTPRelayServerName)

        sysMailer.SMTPRelayServer(SysEmailParameters::find().SMTPRelayServerName,

                                  SysEmailParameters::find().SMTPPortNumber,

                                  SysEmailParameters::find().SMTPUserName,

                                  SysEmailParameters::password(),

                                  SysEmailParameters::find().NTLM

                                  );

        else

        sysMailer.SMTPRelayServer(SysEmailParameters::find().SMTPServerIPAddress,

                                  SysEmailParameters::find().SMTPPortNumber,

                                  SysEmailParameters::find().SMTPUserName,

                                  SysEmailParameters::password(),

                                  SysEmailParameters::find().NTLM

                                  );

     

        sysMailer.fromAddress(GVHEArchiveParameters.FromEmail);

        sysMailer.subject(strFmt("TEST - %1 ",lvCustTable.name()));

     

        sysMailer.tos().appendAddress(EmailAddress);//CustTable.BuzInvoiceEmail);

        sysMailer.attachments().add(_FileName);

     

        sysMailer.htmlBody(strfmt("This mail is for test.",GVHEArchiveTrans.InvoiceNum));

        sysMailer.sendMail();

    }

     

  • Suggested answer
    Ajit Profile Picture
    8,788 on at

    Sorry I just wanted you to use quickSend method. Looks like issue with exchange but still you can try 2 line of code in job to test.

    SysMailer sysMailer = new sysMailer();

    sysMailer. QuickSend(

       str fromAddr,

       str toAddr,

       str subject,

       str body,

      [str cc,

       str attachments])

    Replace variables with values.

  • Community Member Profile Picture
    on at

    Hi Ajit,

    I tried it, still it's not being send to hotmail accounts.

  • Suggested answer
    Ajit Profile Picture
    8,788 on at

    Check with your exchange server administrator. It doesn't look like an application issue.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans