Email Service
Posted on Sep 14, 2012 by Siddhartha
String sendTo = "bob@gmail.com"; String sendSubject = "Here we are sending an Email"; String sendMsg = "Body of message"; String fromEmailId = "jack@gmail.com"; App42Callback requestCallback = this; /* This function used the App42Callback interface */ ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); EmailService emailService = api.BuildEmailService(); emailService.SendMail(sendTo,sendSubject,sendMsg,fromEmail,EmailMIME.PLAIN_TEXT_MIME_TYPE,requestCallback); OnSuccess(Object obj) { Email email = (Email) obj; String jsonResponse = email.ToString(); } public class CallBack : App42Callback { public override void OnSuccess(Object obj) { Email email = (Email) obj; //Do whatever you want with the object } public override void OnException(App42Exception e) { //Do whatever you want with the exception } }
String sendTo = "bob@gmail.com"; String sendSubject = "Here we are sending an Email"; String sendMsg = "Body of message"; String fromEmail = "jack@gmail.com"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); EmailService emailService = api.buildEmailService(); Email email = emailService.sendMail(sendTo, sendSubject, sendMsg, fromEmail, EmailMIME.PLAIN_TEXT_MIME_TYPE); String jsonResponse = email.toString();
String sendTo = "bob@shephertz.com"; String sendSubject = "Here we are sending an Email"; String sendMsg = "Body of message"; String fromEmail = "jack@shephertz.com"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); EmailService emailService = api.buildEmailService(); Email email = emailService.sendMail(sendTo, sendSubject, sendMsg, fromEmail, EmailMIME.PLAIN_TEXT_MIME_TYPE); String jsonResponse = email.toString();
NSString *sendTo = "bob@gmail.com"; NSString *sendSubject = "Here we are sending an Email"; NSString *sendMsg = "Body of message"; NSString *fromEmail = "jack@gmail.com"; NSString *emailMimeType = PLAIN_TEXT_MIME_TYPE; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; EmailService *emailService = [serviceAPIObj buildEmailService]; Email *email = [emailService sendMail:sendTo subject:sendSubject Message:sendMsg fromEmail:fromEmail emailMIME:emailMIME]; NSString jsonResponse = [email toString];
String sendTo = "bob@shephertz.com"; String sendSubject = "Here we are sending an Email"; String sendMsg = "Body of message"; String fromEmail = "jack@shephertz.com"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); EmailService emailService = api.buildEmailService(); Email email = emailService.sendMail(sendTo, sendSubject, sendMsg, fromEmail, EmailMIME.PLAIN_TEXT_MIME_TYPE); String jsonResponse = email.toString();
String sendTo = "bob@shephertz.com"; String sendSubject = "Here we are sending an Email"; String sendMsg = "Body of message"; String fromEmailId = "jack@shephertz.com"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); EmailService emailService = api.BuildEmailService(); Email email = emailService.SendMail(sendTo,sendSubject,sendMsg,fromEmail,EmailMIME.PLAIN_TEXT_MIME_TYPE); String jsonResponse = email.ToString();
sendTo = "bob@gmail.com"; sendSubject = "Here we are sending an Email"; sendMsg = "Body of message"; fromEmailId = "jack@gmail.com"; emailMime = App42::Email::EmailMIME.new(); api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>"); emailService = api.buildEmailService(); email = emailService.sendMail(sendTo, sendSubject, sendMsg, fromEmailId, emailMime.enum("PLAIN_TEXT_MIME_TYPE")); jsonResponse = email.to_s();
The request format for sendMail is URL : https://api.shephertz.com/cloud/1.0/email Method : POST QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP> Accept : application/json Content-Type : application/json Body: {"app42":{"email":{"to": "bob@shephertz.com","subject": "Here we are sending an Email!! ","msg": "Body of message","emailId": "jack@shephertz.com","mimeType": "text/plain"}}}
Coming Soon...
$sendTo = "bob@gmail.com"; $sendSubject = "Here we are sending an Email"; $sendMsg = "Body of message"; $fromEmailId = "jack@gmail.com"; $api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); $emailService = $api->buildEmailService(); $email = $emailService- >sendMail($sendTo, $sendSubject, $sendMsg, $fromEmailId, $EmailMIME::PLAIN_TEXT_MIME_TYPE); $jsonResponse = $email->toString();