Monday, March 05, 2012

Consuming the JangoMail API in ASP.Net

It's easy to start integrating the JangoMail API into your company's .Net software. Start by adding a service reference to your project. Right click on the project in the solution explorer, then click "Add a Service Reference". Under Address, enter http://api.jangomail.com/api.asmx?WSDL and click "Go". Then change the namespace to JangoMail and click "OK". This will add the files necessary to reference the JangoMail web service within your application or website. Then you can call all the JangoMail/JangoSMTP API methods from within your software.

In this two line example, a JangoMailSoapClient object is created, then used to invoke the method that gets a list of the email lists on your account. Download the source code for this example then start your own integration!

// first create the JangoMail soap client object
JangoMail.JangoMailSoapClient j = 
    new JangoMail.JangoMailSoapClient("JangoMailSoap");

// then call the getlist method and display the results
Result.InnerHtml = 
    j.Groups_GetList_String("Your JangoMail/JangoSMTP Username", 
                            "Your JangoMail/JangoSMTP Password", 
                            "<br/>", " - ", "");