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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Sending email using SysMailer in Dynamics AX 2012 CDO.Message - 0x8004020F

(0) ShareShare
ReportReport
Posted on by 155

Hello,

 I have put together code to write a job to send emails to the customers attaching their pdf invoice copies. I used SysEmailer object and it is working pretty well in production for all the customers email addresses except for one customer.

When I looked at the job history I see the error "Method 'send' in COM object of class 'CDO.Message' returned error code 0X8004020F(<unknown>) which means <unknown>."

I also checked to see if there are any spaces before and after the email address in question and also used trim functions to trim any spaces no luck with that either.

Searched google and came across few links that describe the error codes

https://msdaxerp.wordpress.com/2013/03/12/cdo-message-returned-error-code/

My error code means that:

0x8004020F

The server rejected one or more recipient addresses. The server response was: %1

If I understand it correct, our server is rejecting the customer's email address. 

1) I am trying to understand why our server rejects this particular recipients address? 

      But when our users send the invoice pdf to the same address from their outlook it goes through fine and no issues.

 

2) How can catch exceptions in my sendEmail() method for any potential CD.Message errors?

 

Any inputs are greatly appreciated.

 

Thanks!

 

Dev

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    LaneSwenka Profile Picture
    361 on at

    Hi Dev,

    COM errors are essentially a CLRError, see this article for more details:

    msdn.microsoft.com/.../ee677495.aspx

    As for the restrictions by your mail server, it could be numerous and depends on what mail server you are using.

  • Suggested answer
    Community Member Profile Picture
    on at

    I ran into a similar issue.   I am going to assume that you are sending via Exchange.  

    This discussion thread lead me to the answer.   You need to create a new connector and allow anonymous sending from it.   This is why Exchange is rejecting your outside e-mails.

    Corey Vantilborg

  • Suggested answer
    ParkerPeng Profile Picture
    on at

    Hi Dev,

    I think your SMTP server is configured not to relay outside of domain.

    Please check the setting.

    Regards,

    Parker

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans