Pergunta

     <?xml version="1.0" encoding="utf-8"?>
     <SendMail xmlns="ComposeMail:" xmlns:airsync="AirSync">
     <ClientId>34234243</ClientId>
     <SaveInSentItems />
     <Mime>
        From:xxx@.com 
        To:yyy@.com 
        Subject:342234 MIME-Version: 1.0 
        Content-Type: text/plain; 
        charset="iso-8859-1" 
        Content-Transfer-Encoding: base64 
         X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 234234
        This is body  
     </Mime>
     </SendMail>

I am working with SendEmail command. I am looking for way to send Mime content to server. I have tried:

  • Convert the above xml in wbxml and setBOdy HTTP request but server return 103 error code.

  • Convert the Content betweent to Base64, and append to old string like this:

    <?xml version="1.0" encoding="utf-8"?>
    <SendMail xmlns="ComposeMail:" xmlns:airsync="AirSync"><ClientId>34234243</ClientId>
    <SaveInSentItems/>
    <Mime>
     text encode base 64
    </Mime>
    </SendMail>
    

And convert to wbxml, send to server and receive error code 119 mean :MessageHasNoRecipient The message being sent contains no recipient. Anybody help? thanks in advance

Foi útil?

Solução

I am sure you have a blank character before the "To" keyword in your code. Let's remove it. Your data before you encode it to base64 encoding must to look like this:

   From: xxx@xxx.com
   To: xxx@xxx.com 
   Subject: Mail Subject 
   MIME-Version: 1.0 
   Content-Type: text/plain; charset=utf-8 
   Content-Transfer-Encoding: base64 

   Test body

Best regards,

Outras dicas

From MS documentation Mime element must be opaque BLOB https://msdn.microsoft.com/en-us/library/gg663453(v=exchg.80).aspx. So you must write Mime data as CDATA.

<Mime>
<![CDATA[From: xxx@xxx.com
To: xxx@xxx.com 
Subject: Mail Subject 
MIME-Version: 1.0 
Content-Type: text/plain; charset=utf-8 

Test body]]>
</Mime>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top