about email nk support ...

Poster Content
nk4um User
Posts: 37
October 20, 2014 18:22

Posted by tab (View)
Hi Radu, yes I use SMTP all the time this is some code from comb9.com:

INKFRequest req=aContext.createRequest("active:xslt");
req.addArgument("operator","res:/com/comb9/core/data/billing/styleCreditEmail.xsl");
HDSBuilder b=new HDSBuilder();
b.pushNode("root");
b.addNode("username", aUsername);
b.addNode("message",aMessage);
b.addNode("webAddress",webAddress);
req.addArgumentByValue("operand",b.getRoot());
INKFResponseReadOnly messageResponse=aContext.issueRequestForResponse(req);

//Send Mail
req=aContext.createRequest("active:sendmail");
b=new HDSBuilder();
b.pushNode("email");
b.addNode("from","Comb9 <info@comb9.com>");
b.addNode("to",aEmail);
b.addNode("subject","Important information about your Comb9 account");
req.addArgumentByValue("header",b.getRoot());
req.addArgumentFromResponse("body",messageResponse);
aContext.issueAsyncRequest(req);

You also need an SMTPConfig.xml, I use gmail for testing.

Cheers, Tony

Thanks! Actually I saw after the last update that the documentation contains an example too ... I just inspected it few days before the update and that time the doc was incomplete ... Thanks again, Radu.

Like · Post Reply
nk4um Administrator
Posts: 607
October 20, 2014 15:17

Hi Radu, yes I use SMTP all the time this is some code from comb9.com:

INKFRequest req=aContext.createRequest("active:xslt");
req.addArgument("operator","res:/com/comb9/core/data/billing/styleCreditEmail.xsl");
HDSBuilder b=new HDSBuilder();
b.pushNode("root");
b.addNode("username", aUsername);
b.addNode("message",aMessage);
b.addNode("webAddress",webAddress);
req.addArgumentByValue("operand",b.getRoot());
INKFResponseReadOnly messageResponse=aContext.issueRequestForResponse(req);

//Send Mail
req=aContext.createRequest("active:sendmail");
b=new HDSBuilder();
b.pushNode("email");
b.addNode("from","Comb9 <info@comb9.com>");
b.addNode("to",aEmail);
b.addNode("subject","Important information about your Comb9 account");
req.addArgumentByValue("header",b.getRoot());
req.addArgumentFromResponse("body",messageResponse);
aContext.issueAsyncRequest(req);

You also need an SMTPConfig.xml, I use gmail for testing.

Cheers, Tony

Like · Post Reply
1 person likes this post
nk4um User
Posts: 37
October 20, 2014 14:57about email nk support ...

Hi all,

Just wondering if there is an example of how to use the email support that nk standard edition provides ... I'm pretty new to this topic, not sure if there is a SMTP server that could be used for tests ...

Any suggestion/hint will be appreciated.

Thanks,

Radu

Like · Post Reply