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)

Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

(0) ShareShare
ReportReport
Posted on by

i wrote a clicked method in form of salestablelistpage for confirmation of order form which will generate an email to customer, it is generating email but resides in queue as waiting status, even email parameters and template are fine and can broadcast email but email generated by confirm button stuck in queue... help required... My method is given below.

void clicked()
{
SysEmailId sysEmailId = 'OrderForm';
str recipientEmail = "erpadmin@test.com";
CustTable custTable;
Map mappings;
;
super();

custTable = custTable :: find(SalesTable.CustAccount);
recipientEmail = custTable.email();

mappings = new Map(Types::String, Types::String);
mappings.insert('CustomerName', custTable.name());
mappings.insert('OrderNumber','');
mappings.insert('OrderDate',SalesTable.createDate());
mappings.insert('OrderTotal','');

SysEmailTable::sendMail(
sysEmailId,
SysEmailTable::find(sysEmailId).DefaultLanguage,
recipientEmail,
mappings,
'',
'',
true,
curUserId(),
true);
}

Thanks,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at
    RE: Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

    Do you have email sending batch running ? What is the status of email in queue ?

  • Community Member Profile Picture
    on at
    RE: Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

    Status is waiting(0), and i have create a email template named OrderForm which is mentioned in  my code.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at
    RE: Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

    Did you check a batch job ? You can setup it in System administration > Periodic > E-mail processing > Batch.

    It should be scheduled recurrently and running.

    Do you have issue only with this email or you cannot send any through the queue ?

  • Community Member Profile Picture
    on at
    RE: Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

    Yes email distribution batch is running and if i broadcast email from System Administratin > Periodic > Email processing > Email Broadcast... so it work very smoothly but not by my way...  

  • srinivas pamidi Profile Picture
    1,737 on at
    RE: Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

    Hai SyedAamirRaza,

    You Find out the Solution for this Problem?

    If you Got it Please share me i am also facing the Same Problem

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: Auto email after order confirmation via AX 2012 R3 with SMTP relay server of Office365...

    Make sure that under Tools > Options, the user who generates the e-mail entry for the table has the E-mail popuated with a valid address. Some mail servers require a sender to be filled in. Also you might want to make sure that Relaying is enabled on the mail server.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans