We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Expected XML Email Schema for emailMessage

I am writing a small script to interact with an API that uses the Aspose XML format for email.

I have a working example for a JSON formatted message, but when naively converting this to XML, it does’nt work.

Could someone please point me to (or post) an XML example, or the schema that is expected?

The JSON version that works is as follows:
{ "emailMessage": { "name": null, "to": "me@example.com", "subject": "email test", "body": "Did you get this?" } }

The XML that does not work is this:
<?xml version="1.0" encoding="UTF-8" ?>
<name />
<subject>email test</subject>
<body>Did you get this?</body>

The latter results in the error message:
Value cannot be null.
Parameter name: to

Any pointers would be greatly appreciated.



Could you please share a working code sample of how you are achieving this? MailMessage.load takes input stream or file path to load an email message.

Only the Server API is using aspose. I am not using it to build the XML request (which I’m currently doing by hand, later I will implement the client request in javascript).

I also do not have access to the source code of the server’s API.



Could you please confirm to us if the server is using Aspose.Email for Cloud API or normal Java/.NET API? We need to know how the server is exposing the calls to you for getting the data from it.

Normal Java API


It seems that there is some custom implementation of messages at your end which provides the data to you accordingly and you need to consult the developer of that application. Aspose.Email for Java API lets you load mime messages from file or from stream for further manipulation. Please have a look at this documentation section and let us know if we can be of any additional help to you in this regard.

Thanks @kashif.iqbal,

So the aspose email API does not support a particular XML format for email by default?


The API supports reading MIME messages, HTML and MHTML files only for creating MailMessage objects. There is no such feature where the API can generate MailMessage from XML format.