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
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).
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é
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
Hi Andre,
Hope you are fine.
i did a try but there is no SMTP
Please find the below attachment
Please Suggest me.
Regards.
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.
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?
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.
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
i am trying to add in confirmation level and tested the code is
SalesTableListpage --> Confirmation Button
After Confirmation,As i am seeing in Email sending Status Form
it is showing failed
So,please guide me what i have done wrong
Regards.
Have a great day Andre.
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;
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156