Results 1 to 2 of 2

Thread: Send mail in zimlet ext

  1. #1
    Join Date
    Apr 2007
    Posts
    5
    Rep Power
    8

    Default Send mail in zimlet ext

    I want to send a mail from my zimlet,If I want to send a soap request in my javascript code,What should I do for this?The code below works?
    function send_request(){
    var url="servername\service\soap\SendMsgRequest";
    var xml="<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
    <context xmlns="urn:zimbra">
    <userAgent name="ZimbraWebClient - FF2.0 (Win)" version="4.5.4_GA_763.FC4"/><sessionId id="111" />
    <change token="59553" type="new"/>
    <authToken>(REMOVED)</authToken>
    <format type="js"/></context>
    </soap:Header>
    <soap:Body>
    <SendMsgRequest xmlns="urn:zimbraMail" suid="1177704687970"> <m idnt="2199a0c6-568b-11da-92a1-efa4f3028220"><e t="t" a="josh@hisdomain.com"/>
    <e t="f" a="josh@hisdomain.com" p="Joshua R. Prismon"/>
    <su>This is the message title</su>
    <mp ct="multipart/alternative">
    <mp ct="text/plain">
    <content>This is the message content </content>
    </mp>
    <mp ct="text/html"><content>&lt;html&gt;&lt;head&gt;&lt;style type='text/css'&gt;body
    { font-family: 'Arial'; font-size: 12pt; color: #000000}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;This
    is the message content&lt;br&gt;&lt;/body&gt;&lt;/html&gt;</content></mp></mp></m></SendMsgRequest>
    </soap:Body></soap:Envelope>";

    if(window.XMLHttpRequest){
    http_request=new XMLHttpRequest();
    }
    else if(window.ActiveXObject){
    try{
    http_request=new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
    try{
    http_request=new ActiveXObject("Microsoft.XMLHTTP");
    }catch(e){}
    }

    }
    http_request.onreadystatechange=processRequest;
    http_request.open("POST",url,false);
    //http_request.setRequestHeader("Content-Type","text/xml");
    http_request.send(xml);
    }

    I don't know weather this method works,Are there any exist functions better than above?
    if without using soap,Are there other class or method or library for sending a mail in zimlet's javascript code?
    Thanks for your attention,I'll be so appreciate if you can show any detail about it.
    Last edited by lix830917; 04-28-2007 at 12:02 AM.

  2. #2
    Join Date
    Jul 2006
    Location
    Virginia Beach, VA
    Posts
    97
    Rep Power
    9

    Default One problem I see...

    This makes your zimlet very Internet Explorer specific. This code will not work in firefox. The main idea behind the Zimbra framework is it is browser independent. If you can get the code correct, it will generate the correct information for the browser the users is using. The problem is, the zimbra framework is a bit complicated.
    EricX

Similar Threads

  1. Problems with port 25
    By yogiman in forum Installation
    Replies: 57
    Last Post: 06-13-2011, 01:55 PM
  2. Replies: 7
    Last Post: 02-03-2011, 06:01 AM
  3. fresh install down may be due to tomcat
    By gon in forum Installation
    Replies: 10
    Last Post: 07-25-2007, 08:09 AM
  4. DynDNS and Zimbra
    By afterwego in forum Installation
    Replies: 30
    Last Post: 04-01-2007, 03:34 PM
  5. Installed OK - Can send but not recieve email
    By gregbazar in forum Installation
    Replies: 3
    Last Post: 11-05-2005, 03:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •