Created
April 28, 2014 22:44
-
-
Save JeremyMorgan/11386248 to your computer and use it in GitHub Desktop.
Contact Controller - Win API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public HttpResponseMessage Post([FromBody] PostObject ourPostObject) | |
| { | |
| try | |
| { | |
| // Debug.WriteLine(ourPostObject.testValue); | |
| // post object | |
| Mailer ourMailer = new Mailer(); | |
| try | |
| { | |
| ourMailer.sendEmail(ourPostObject.recipient, ourPostObject.subject, ourPostObject.message); | |
| } | |
| catch (Exception ex) | |
| { | |
| Debug.WriteLine(ex.ToString()); | |
| } | |
| ourPostObject.status = "SENT"; | |
| return Request.CreateResponse(HttpStatusCode.OK, ourPostObject); | |
| } | |
| catch (Exception ex) | |
| { | |
| return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment