Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-23-2007, 10:57 AM
sos100 sos100 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 3
sos100 is on a distinguished road
Default [SOLVED] Can a zimlet send an email?

Stoopid question perhaps: can a zimlet send an email "itself". That is - is there an API available to let a zimlet send an email as part of the various activities it's completing?

Apologies in advance if this is a lame question - had a look and couldn't find out.

Cheers,
Sean
Reply With Quote
  #2 (permalink)  
Old 10-24-2007, 09:33 AM
lfasci lfasci is offline
Senior Member
 
Join Date: Jul 2006
Posts: 53
lfasci is on a distinguished road
Default

I edited the message to show full code


It_Seacom_Zimlet.prototype.getUserDisplayName =
function() {
if(!appCtxt.get(ZmSetting.DISPLAY_NAME)) return "";
return appCtxt.get(ZmSetting.DISPLAY_NAME);
};
It_Seacom_Zimlet.prototype.getUserReplyTo =
function() {
return appCtxt.get(ZmSetting.REPLY_TO_ADDRESS);
};

It_Seacom_Zimlet.prototype._sendMsg =
function(destName, destEmail, subject, body) {
var soapDoc = AjxSoapDoc.create("SendMsgRequest", "urn:zimbraMail", "noSave=0");
var m = soapDoc.set("m");
m.setAttribute("idnt", this.userID);
var node_e = soapDoc.set("e", null, m);
node_e.setAttribute("p", this.getUserDisplayName() );
node_e.setAttribute("a", this.getUserReplyTo());
node_e.setAttribute("t", "f");
node_e.setAttribute("p", destName);
node_e.setAttribute("a", destEmail);
node_e.setAttribute("t", "t");
var node_s = soapDoc.set("su",subject , m);
var node = soapDoc.set("mp", null, m);
node.setAttribute("ct", "text/plain");
var subnode = soapDoc.set("content", body, node);
var command = new ZmCsfeCommand();
var resp = command.invoke({soapDoc: soapDoc});
var r = "Message sent";
DBG.println(AjxDebug.DBG2, "result:" + r);
this.displayStatusMessage(r);
};
__________________
http://www.seacom.it

Last edited by lfasci : 02-28-2008 at 10:44 AM.
Reply With Quote
  #3 (permalink)  
Old 10-24-2007, 09:48 AM
sos100 sos100 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 3
sos100 is on a distinguished road
Default Thanks!

Thanks - a quick follow-on question: that is JavaScript creating a SOAP request - right? Where would I find the API documentation for those Zimbra SOAP APIs?

Cheers,

Sean
Reply With Quote
  #4 (permalink)  
Old 10-24-2007, 12:51 PM
JoshuaPrismon JoshuaPrismon is offline
Moderator
 
Join Date: Nov 2005
ZCS Version: Release 5.0.0_BETA2_1092.FC5_20070718124259 FC5_64 FOSS edition
Posts: 380
JoshuaPrismon is on a distinguished road
Send a message via AIM to JoshuaPrismon
Default

The code is really documented.... in the code. Thanks for digging this far, I wonder if one of you would be so kind as to put this up on the wiki?
Reply With Quote
  #5 (permalink)  
Old 10-25-2007, 06:55 AM
sos100 sos100 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 3
sos100 is on a distinguished road
Default Up on Wiki

Happy to put it up on the Wiki. Will have a dig around and see where best to put that.

Cheers,

Sean
Reply With Quote
  #6 (permalink)  
Old 10-29-2007, 01:41 AM
lfasci lfasci is offline
Senior Member
 
Join Date: Jul 2006
Posts: 53
lfasci is on a distinguished road
Default SOAP docs

You can find the SOAP docs here

SourceForge.net Repository - [zimbra] Index of /trunk/ZimbraServer/docs

pay attention some synta x is old.
__________________
http://www.seacom.it
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.zimbra.com/forums/zimlets/12314-solved-can-zimlet-send-email.html
Posted By For Type Date
Zimlets - Zimbra - Forums This thread Refback 11-23-2007 08:40 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
need advice on configuring zimbra to work with fax server pheonix1t Administrators 0 07-11-2007 07:46 PM
Post instsallation problems Assaf Installation 14 01-29-2007 10:38 AM
upgrade to 4.0.3 antispam does'nt work lucanannipieri Administrators 14 11-07-2006 02:56 AM
Kickstart for automated installation and disaster recovery mubley Installation 19 01-10-2006 02:45 PM


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.0.0