What is the Client App.?
theMailMonster.com Client App is a Program (Application) that runs on
your PC. Instead of opening a browser and visiting theMailMonster.com website,
you can just run this App.
The purpose of the Base Version is to demonstrate how an Application on your
PC can communicate with theMailMoster.com Server and API's to send mail and store files.
Note: Feature requests or suggestions are most welcomed.
List of our API's:
File API
With this API you can Upload Files to theMailMonster.com File Repository from your own Application.
Create smart applications using our File API. From your own application you can communicate
with our File Servers to store and retrieve files.
Mail API
With this API you can Send Letters from your own application.
Save time and money by outsourcing the printing and delivery of your letters to us.
SMS API
With this API you can Send SMS's from your own application.
Increase communication with your customers by using our SMS API.
Instructions
To use theMailMonster.com API's you will need to register. Once registered, click on the Account Folder
and Generate a Key.
All of the API's require your User Id, Email, Key.
Use this API to Upload Files and Get Files from theMailMonster.com File Repository.
Technical Details
• You will need the TmmAPI.dll for a .NET (C#) or
TmmAPI.jar for Java.
• Depending on the server load, requests may take up to 5 seconds.
Limitations
• Maximum file size for upload and retrieval is 1MB.
• Valid Mime Types for the UploadFile() Method are:
<document>
<info>
<!-- Common Errors -->
<error>Invalid User Id, Email and Key combination.</error>
<error>Invalid Folder.</error>
<error>Could not connect to server. Try again.</error>
<error>You have not yet connected. Please use the Connect() or SecureConnect() Method.</error>
<error>Max Upload Size Exceeded.</error>
<error>Please generate a key.</error>
<error>An unknown error has occurred.</error>
<!-- UploadFile() Errors -->
<error>File Name Missing.</error>
<error>File Name is blank.</error>
<error>File Type (Mime Type) Missing.</error>
<error>Invalid File Type (Mime Type).</error>
<error>File is greater than 1MB (1024000 bytes).</error>
<error>Upload file error. Could not upload the file. [ err ].</error>
<error>Unable to decode base64 data.</error>
<!-- GetFileList() Errors -->
<error>No Files Found.</error>
<!-- GetFile() Errors -->
<error>No Files Found.</error>
<error>Get file error. Could not get the file.</error>
<error>Unable to decode base64 data.</error>
</info>
</document>
Use this API to Send Letters from your application/website.
Technical Details
• You will need the TmmAPI.dll for a .NET (C#) or
TmmAPI.jar for Java.
• Depending on the server load, requests may take up to 5 seconds.
PDF Specifications
• Include a Blank Page as the 1st Page of the PDF - OR - Keep the
Address Block Area clear.
• Paper Size is LETTER, size 8.5" x 11".
• Envelope is Business envelope #10 double window, size: 4 1/8" x 9 1/2".
IMPORTANT - Before you go Live (Production Mode)
• Ensure you call the Testing() Method. e.g. ObjTmmMailItem.Testing()
• If your letter is successfully sent:
1. Xml Result will contain the "<result>" node insted of "<error>" node.
2. Details of the Recipient will be stored your PDF's Folder. e.g. TMM-letter-api-1234-cl.xml 3. A copy of the PDF File will be stored in your PDF's Folder. e.g. TMM-letter-api-1234-cl.pdf
• Contact us to confirm your mail item has been processed. That's it! You can now go to Production Mode.
Limitations
• Maximum file size for SetPDFData() Method is 1MB.
• Valid Mime Type for the SetPDFData() Method is application/pdf.
Cost
• $0.95 (USD) per letter - United States
• $2.10 (USD) per letter - Other Countries
• Add $0.35 for additional pages.
TmmMailItem ObjTmmMailItem = new TmmMailItem();
ObjTmmMailItem.Connect("12345678","john@sample.com","sO9wKdvSFZeuZ3mhNIocV");
ObjTmmMailItem.SetName("John Sample");
ObjTmmMailItem.SetAddressLine1("1 Sample Street");
ObjTmmMailItem.SetAddressLine2("");
ObjTmmMailItem.SetTownCity("LOS ANGELES");
ObjTmmMailItem.SetState("CA");
ObjTmmMailItem.SetZipPostcode("90200");
ObjTmmMailItem.SetCountry("United States");
ObjTmmMailItem.Testing(); // Set this for testing mode. You will not be charged.
byte[] BinaryData = ObjTmmMailItem.FileToByteArray("MyLocalLetter.pdf");
ObjTmmMailItem.SetPDFData(BinaryData);
ObjTmmMailItem.Send();
if(ObjTmmMailItem.HasError())
Console.WriteLine(ObjTmmMailItem.GetError());
else
{
XmlResult = ObjTmmMailItem.GetXmlResult();
Console.WriteLine(XmlResult);
}
Error Messages
<document>
<info>
<!-- Common Errors -->
<error>Invalid User Id, Email and Key combination.</error>
<error>Invalid Folder.</error>
<error>Could not connect to server. Try again.</error>
<error>You have not yet connected. Please use the Connect() or SecureConnect() Method.</error>
<error>Max Upload Size Exceeded.</error>
<error>Please generate a key.</error>
<error>An unknown error has occurred.</error>
<!-- Send Mail Item Errors -->
<error>Please add credit to your account.</error>
<error>Could not calculate number of pages.</error>
<error>File is greater than 1MB (1024000 bytes).</error>
<error>Web Service Error.</error>
<error>You do not have enough credit. It will cost $X.xx to send this mail item.</error>
<error>Mandatory Field Missing.</error>
</info>
</document>