Relay Email

Last updated: October 20th 2021

Introduction

About Relay Email

Send email directly using our API. The Send Email API acts as an email relay. Note that all of these operations require a session token - see the authentication section for more information.

For a full guide to setting up a relay account in Sensorpro, click here.

SendEmail

This API call accepts an email and sends it using our email servers. Signin must be executed before any other service is executed. This establishes your session and identification for subsequent requests. The session will time out if the token is not used. Do not execute a signin for each API request as this will affect performance and a single seesion should be used to process all email you have at that time. When finished ensure you logoff the active session.

Endpoint
Method: POST
https://apinie.sensorpro.net/api/Email/SendEmail/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the signin.
Header Values
Header Example Description
Content-Type application/json  

Request Body


    {
        "From": {
            "DisplayName": "Marketing",
            "Email": "richard@sensorpro.net"
        },
        "To": [
            {
            "DisplayName": "",
            "Email": "sampleemail@acme.com"
            },
            {
            "DisplayName": "",
            "Email": "sampleemail1@acme.com"
            }
        ],
        "Cc": [],
        "Bcc": [],
        "Headers": {},
        "ReplyTo": null,
        "ReturnPath": null,
        "Subject": "My sample email  😀 ",
        "HTMLMessageStyle": "@import url('https://fonts.googleapis.com/css2?family=Prompt&display=swap');	@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');         @font-face {             font-family: Futura;             font-weight: 700;             font-style: oblique;             src: url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff"),                  url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff");        }        /* Force Outlook to provide a "view in browser" message */#outlook a {padding:0;} /* Force width of 100% on main container tables */.ReadMsgBody {width:100% !important;}/* Force Hotmail to display emails at full width */.ExternalClass {width:100%;} /* Force Hotmail to display normal line spacing */.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} body, table, td {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}/* Prevent WebKit and Windows mobile changing default text sizes */a {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} /* Remove spacing between tables in Outlook 2007 and up */table, td {mso-table-lspace:0pt;mso-table-rspace:0pt;} /* Allow smoother rendering of resized image in Internet Explorer */img {-ms-interpolation-mode:bicubic;} /* RESET STYLES */body {margin:0;padding:0;}img {border:0;height:auto;outline:none;text-decoration:none;}table {border-collapse:collapse !important;}body {height:100% !important;margin:0;padding:0;width:100% !important;min-width:100% !important;}.webversion-link a {color:#777777;}/* iOS BLUE LINKS */.appleBody a {color:#777777;text-decoration: none;}.appleFooter a {color:#777777;text-decoration: none;}.img-mobile {display: none;}/* MOBILE STYLES */@media screen and (max-width: 525px) {/* ALLOWS FOR FLUID TABLES */.wrapper {width:100% !important;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.logo {width: 90%;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.webversion {}/* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */.mobile-hide {display: none !important;}.img-max {max-width: 100% !important;height:auto !important;}.header-image-cell {width: 100% !important; min-width: 100% !important;height: auto !important;}.header-image-cell img {width: 100% !important;min-width: 100% !important; height: auto !important;}.img-mobile {display: block !important;}.img-desktop {display: none !important;}.tgFooterTable {border-right:none!important;}.footerright {text-align:center!important;}.footerleft {text-align:center!important;}/* FULL-WIDTH TABLES */.responsive-table {width:100% !important;min-width: 100% !important;}.tgInner {width:100% !important;}.tgButton {width:100% !important;}.tgBCHeight {width:100% !important;}.tgHeadingBlock {width:100% !important;}.responsive-table-footer {width:100% !important;}.responsive-table-3col {width:100% !important;text-align:center !important;margin-left:auto !important;margin-right:auto !important;}/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */.padding {padding: 10px 5% 15px 5% !important;}.padding-copy {padding: 10px 5% 10px 5% !important;}.padding-meta {padding: 30px 5% 0px 5% !important;text-align: center;}.no-pad {padding: 0 0 20px 0 !important;}.no-padding {padding: 0 !important;}.section-padding {padding: 20px 10px 50px 10px !important;}.section-padding-bottom-image {padding: 50px 15px 0 15px !important;}/* ADJUST BUTTONS ON MOBILE */.mobile-wrapper {padding: 10px 5% 15px 5% !important;}.mobile-button-container {margin:0 auto;width:100% !important;}.mobile-button {width:80% !important;padding: 15px !important;border: 0 !important;font-size: 16px !important;}}",
        "HTMLMessageEncoded": "<table id="Layout56" class="ReadMsgBody tgOuter" style="table-layout: fixed; border-collapse: collapse; width: 100% !important; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td align="center"><table class="responsive-table tgInner" style="background-color: #ffffff; width: 600px; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgContainer" style="padding: 0 0 0 0;" align="center"><table class="responsive-table tgInner" style="border-collapse: collapse; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="header-image-cell" style="color: rgb(255, 255, 255); width: 600px; min-width: 600px; height: 115px;" align="center"><span class="mcEditImg" style="position: relative;"><img src="https://images.newsletter.ie/nclients/Images/logo-1200xcpy2xcrop1.png" alt="" class="" width="170" height="115" border="0" style="display: block; color: rgb(255, 255, 255); width: 170px; height: 115px; min-width: 170px; max-height: 115px;"></span></td></tr><tr><td class="tgContainer" style="padding: 25px 10px 5px 15px; font-size: 22px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgHeading1" style="position: relative; font-family: Helvetica; font-size: 28px;" spellcheck="false">Sample HTML Message</span></td></tr><tr><td class="tgContainer" style="padding: 15px; font-size: 14px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgBody" style="position: relative; font-family: Helvetica; font-size: 20px; color: rgb(51, 51, 51);" spellcheck="false">This is a text block for your feature article. This text will be the full width of your email and centred. Delete this text and add your own!</span></td></tr><tr><td class="tgContainer"><!-- BUTTON --><table class="mobile-button-container" style="width: 100%;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="padding-copy" style="padding: 15px 0 25px 0;" align="center"><table class="responsive-table tgInner tgButton" style="background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgButtonDef" align="center" style="background-color: rgb(190, 146, 83);"><a class="mcEdit mobile-button" style="font-size: 18px; font-family: Helvetica; font-weight: normal; color: rgb(255, 255, 255); text-decoration: none; background-color: rgb(190, 146, 83); border-width: 15px 25px; border-style: solid; border-color: rgb(190, 146, 83); border-radius: 3px; display: inline-block; position: relative;" spellcheck="false" href="https://sensorpro.net" target="_blank" rel="noopener noreferrer" title="">Find out more ›</a></td></tr></tbody></table></td></tr></tbody></table><!-- END BUTTON --></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>",
        "PlainTextMessage": "",
        "MsgType": 0,
        "MailEncoding": "UTF-8",
        "Schedule": {
        "DelayByMinutes": 0,
        "DelayUntilUTC": ""
        }
    }

Input Parameters

Email address format. All email address should have a "DisplayName" optional and "Email" which is required.

    {
        "DisplayName": "",
        "Email": "sampleemail@acme.com"
    }

  • Required
    • From: From email address
    • To: To email address (maximum of 20 emails). If more than one email specified, each email will be sent individually.
    • Subject: Email subject line
    • HTMLMessageStyle: Style sheet for email message. This should be HTML encoded.
    • HTMLMessageEncoded: If email is HTML. This contains the HTML encoded version of the email. This should also include any CSS styling.
    • PlainTextMessage: If email is plain text, this contains email text.
    • MessageType: 0 = HTML 10 = Text
    • MailEncoding: Default UTF8
  • Optional
    • Headers: List of custom email headers which you may want to add. If not passing any headers set to null or {}
      
          "Headers": {
              "MyCustomHeader": "1234567890",
              "MyCustomHeader1": "1234567890"
          }
      
    • ReplyTo: Reply to email address. Set to null if not using "ReplyTo": null
    • ReturnPath: Email return path. Set to null if not using "ReturnPath": null
    • CC: Array of copy to email address. Set to empty "ReturnPath": "Cc": []
    • Bcc: Array of blind carbon copy email address. Set to empty "Bcc": "Cc": []
    • Schedule: Schedule options
      •   Schedule DelayByMinutes: Delay send by x minutes
      •   Schedule DelayUntilUTC: Delay send to specific date and time date must be specified in UTC format

Response Output


    {
        "Result": {
        "RequestId": "03d39d73-db4f-4337-8b7d-68897829f95c",
        "ErrorMessages": [],
        "StatusMesssages": [],
        "TotalStatusMessages": 0,
        "TotalErrors": 0
        }
    }
Response Values:
  • RequestId - Unique ID for the request
  • ErrorMessages - Error messages (if any)
  • StatusMesssages - Status messages (if any)
  • TotalStatusMessages - Total status messages
  • TotalErrors - Total errors
Sample Code:

    var client = new RestClient("https://apinie.sensorpro.net/api/Email/SendEmail/ae7e0541-e0d5-4c61-ab21-6e7447cbead8");
    client.Timeout = -1;
    var request = new RestRequest(Method.POST);
    request.AddHeader("Content-Type", "application/json");
    var body = @"{
        " + "\n" +
        @"        ""From"": {
        " + "\n" +
        @"            ""DisplayName"": ""Marketing"",
        " + "\n" +
        @"            ""Email"": ""richard@sensorpro.net""
        " + "\n" +
        @"        },
        " + "\n" +
        @"        ""To"": [
        " + "\n" +
        @"            {
        " + "\n" +
        @"            ""DisplayName"": """",
        " + "\n" +
        @"            ""Email"": ""rcoady@gmail.com""
        " + "\n" +
        @"            },
        " + "\n" +
        @"            {
        " + "\n" +
        @"            ""DisplayName"": """",
        " + "\n" +
        @"            ""Email"": ""rco.ady@gmail.co""
        " + "\n" +
        @"            }
        " + "\n" +
        @"        ],
        " + "\n" +
        @"        ""Cc"": [],
        " + "\n" +
        @"        ""Bcc"": [],
        " + "\n" +
        @"        ""Headers"": {},
        " + "\n" +
        @"        ""ReplyTo"": null,
        " + "\n" +
        @"        ""ReturnPath"": null,
        " + "\n" +
        @"        ""Subject"": ""My sample email  😀 "",
        " + "\n" +
        @"        ""HTMLMessageStyle"": ""@import url('https://fonts.googleapis.com/css2?family=Prompt&display=swap');	@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');         @font-face {             font-family: Futura;             font-weight: 700;             font-style: oblique;             src: url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff"),                  url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff");        }        /* Force Outlook to provide a "view in browser" message */#outlook a {padding:0;} /* Force width of 100% on main container tables */.ReadMsgBody {width:100% !important;}/* Force Hotmail to display emails at full width */.ExternalClass {width:100%;} /* Force Hotmail to display normal line spacing */.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} body, table, td {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}/* Prevent WebKit and Windows mobile changing default text sizes */a {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} /* Remove spacing between tables in Outlook 2007 and up */table, td {mso-table-lspace:0pt;mso-table-rspace:0pt;} /* Allow smoother rendering of resized image in Internet Explorer */img {-ms-interpolation-mode:bicubic;} /* RESET STYLES */body {margin:0;padding:0;}img {border:0;height:auto;outline:none;text-decoration:none;}table {border-collapse:collapse !important;}body {height:100% !important;margin:0;padding:0;width:100% !important;min-width:100% !important;}.webversion-link a {color:#777777;}/* iOS BLUE LINKS */.appleBody a {color:#777777;text-decoration: none;}.appleFooter a {color:#777777;text-decoration: none;}.img-mobile {display: none;}/* MOBILE STYLES */@media screen and (max-width: 525px) {/* ALLOWS FOR FLUID TABLES */.wrapper {width:100% !important;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.logo {width: 90%;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.webversion {}/* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */.mobile-hide {display: none !important;}.img-max {max-width: 100% !important;height:auto !important;}.header-image-cell {width: 100% !important; min-width: 100% !important;height: auto !important;}.header-image-cell img {width: 100% !important;min-width: 100% !important; height: auto !important;}.img-mobile {display: block !important;}.img-desktop {display: none !important;}.tgFooterTable {border-right:none!important;}.footerright {text-align:center!important;}.footerleft {text-align:center!important;}/* FULL-WIDTH TABLES */.responsive-table {width:100% !important;min-width: 100% !important;}.tgInner {width:100% !important;}.tgButton {width:100% !important;}.tgBCHeight {width:100% !important;}.tgHeadingBlock {width:100% !important;}.responsive-table-footer {width:100% !important;}.responsive-table-3col {width:100% !important;text-align:center !important;margin-left:auto !important;margin-right:auto !important;}/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */.padding {padding: 10px 5% 15px 5% !important;}.padding-copy {padding: 10px 5% 10px 5% !important;}.padding-meta {padding: 30px 5% 0px 5% !important;text-align: center;}.no-pad {padding: 0 0 20px 0 !important;}.no-padding {padding: 0 !important;}.section-padding {padding: 20px 10px 50px 10px !important;}.section-padding-bottom-image {padding: 50px 15px 0 15px !important;}/* ADJUST BUTTONS ON MOBILE */.mobile-wrapper {padding: 10px 5% 15px 5% !important;}.mobile-button-container {margin:0 auto;width:100% !important;}.mobile-button {width:80% !important;padding: 15px !important;border: 0 !important;font-size: 16px !important;}}"",
        " + "\n" +
        @"        ""HTMLMessageEncoded"": ""<table id="Layout56" class="ReadMsgBody tgOuter" style="table-layout: fixed; border-collapse: collapse; width: 100% !important; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td align="center"><table class="responsive-table tgInner" style="background-color: #ffffff; width: 600px; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgContainer" style="padding: 0 0 0 0;" align="center"><table class="responsive-table tgInner" style="border-collapse: collapse; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="header-image-cell" style="color: rgb(255, 255, 255); width: 600px; min-width: 600px; height: 115px;" align="center"><span class="mcEditImg" style="position: relative;"><img src="https://images.newsletter.ie/nclients/Images/logo-1200xcpy2xcrop1.png" alt="" class="" width="170" height="115" border="0" style="display: block; color: rgb(255, 255, 255); width: 170px; height: 115px; min-width: 170px; max-height: 115px;"></span></td></tr><tr><td class="tgContainer" style="padding: 25px 10px 5px 15px; font-size: 22px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgHeading1" style="position: relative; font-family: Helvetica; font-size: 28px;" spellcheck="false">Sample HTML Message</span></td></tr><tr><td class="tgContainer" style="padding: 15px; font-size: 14px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgBody" style="position: relative; font-family: Helvetica; font-size: 20px; color: rgb(51, 51, 51);" spellcheck="false">This is a text block for your feature article. This text will be the full width of your email and centred. Delete this text and add your own!</span></td></tr><tr><td class="tgContainer"><!-- BUTTON --><table class="mobile-button-container" style="width: 100%;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="padding-copy" style="padding: 15px 0 25px 0;" align="center"><table class="responsive-table tgInner tgButton" style="background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgButtonDef" align="center" style="background-color: rgb(190, 146, 83);"><a class="mcEdit mobile-button" style="font-size: 18px; font-family: Helvetica; font-weight: normal; color: rgb(255, 255, 255); text-decoration: none; background-color: rgb(190, 146, 83); border-width: 15px 25px; border-style: solid; border-color: rgb(190, 146, 83); border-radius: 3px; display: inline-block; position: relative;" spellcheck="false" href="https://sensorpro.net" target="_blank" rel="noopener noreferrer" title="">Find out more ›</a></td></tr></tbody></table></td></tr></tbody></table><!-- END BUTTON --></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>"",
        " + "\n" +
        @"        ""PlainTextMessage"": ""Email body if plain text email"",
        " + "\n" +
        @"        ""MsgType"": 0,
        " + "\n" +
        @"        ""MailEncoding"": ""UTF-8"",
        " + "\n" +
        @"        ""Schedule"": {
        " + "\n" +
        @"            ""DelayByMinutes"": 0,
        " + "\n" +
        @"            ""DelayUntilUTC"": """"
        " + "\n" +
        @"        }
        " + "\n" +
        @"    }";
    request.AddParameter("application/json", body,  ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);



curl --location --request POST 'https://apinie.sensorpro.net/api/Email/SendEmail/34f10088-b34d-4530-86f6-f6607dbc0345' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "From": {
    "DisplayName": "Marketing",
    "Email": "richard@sensorpro.net"
    },
    "To": [
    {
    "DisplayName": "",
    "Email": "rcoady@gmail.com"
    },
    {
    "DisplayName": "",
    "Email": "rco.ady@gmail.co"
    }
    ],
    "Cc": [],
    "Bcc": [],
    "Headers": {},
    "ReplyTo": null,
    "ReturnPath": null,
    "Subject": "My sample email  😀 ",
    "HTMLMessageStyle": "@import url('https://fonts.googleapis.com/css2?family=Prompt&display=swap');	@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');         @font-face {             font-family: Futura;             font-weight: 700;             font-style: oblique;             src: url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff"),                  url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff");        }        /* Force Outlook to provide a "view in browser" message */#outlook a {padding:0;} /* Force width of 100% on main container tables */.ReadMsgBody {width:100% !important;}/* Force Hotmail to display emails at full width */.ExternalClass {width:100%;} /* Force Hotmail to display normal line spacing */.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} body, table, td {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}/* Prevent WebKit and Windows mobile changing default text sizes */a {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} /* Remove spacing between tables in Outlook 2007 and up */table, td {mso-table-lspace:0pt;mso-table-rspace:0pt;} /* Allow smoother rendering of resized image in Internet Explorer */img {-ms-interpolation-mode:bicubic;} /* RESET STYLES */body {margin:0;padding:0;}img {border:0;height:auto;outline:none;text-decoration:none;}table {border-collapse:collapse !important;}body {height:100% !important;margin:0;padding:0;width:100% !important;min-width:100% !important;}.webversion-link a {color:#777777;}/* iOS BLUE LINKS */.appleBody a {color:#777777;text-decoration: none;}.appleFooter a {color:#777777;text-decoration: none;}.img-mobile {display: none;}/* MOBILE STYLES */@media screen and (max-width: 525px) {/* ALLOWS FOR FLUID TABLES */.wrapper {width:100% !important;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.logo {width: 90%;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.webversion {}/* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */.mobile-hide {display: none !important;}.img-max {max-width: 100% !important;height:auto !important;}.header-image-cell {width: 100% !important; min-width: 100% !important;height: auto !important;}.header-image-cell img {width: 100% !important;min-width: 100% !important; height: auto !important;}.img-mobile {display: block !important;}.img-desktop {display: none !important;}.tgFooterTable {border-right:none!important;}.footerright {text-align:center!important;}.footerleft {text-align:center!important;}/* FULL-WIDTH TABLES */.responsive-table {width:100% !important;min-width: 100% !important;}.tgInner {width:100% !important;}.tgButton {width:100% !important;}.tgBCHeight {width:100% !important;}.tgHeadingBlock {width:100% !important;}.responsive-table-footer {width:100% !important;}.responsive-table-3col {width:100% !important;text-align:center !important;margin-left:auto !important;margin-right:auto !important;}/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */.padding {padding: 10px 5% 15px 5% !important;}.padding-copy {padding: 10px 5% 10px 5% !important;}.padding-meta {padding: 30px 5% 0px 5% !important;text-align: center;}.no-pad {padding: 0 0 20px 0 !important;}.no-padding {padding: 0 !important;}.section-padding {padding: 20px 10px 50px 10px !important;}.section-padding-bottom-image {padding: 50px 15px 0 15px !important;}/* ADJUST BUTTONS ON MOBILE */.mobile-wrapper {padding: 10px 5% 15px 5% !important;}.mobile-button-container {margin:0 auto;width:100% !important;}.mobile-button {width:80% !important;padding: 15px !important;border: 0 !important;font-size: 16px !important;}}",
    "HTMLMessageEncoded": "<table id="Layout56" class="ReadMsgBody tgOuter" style="table-layout: fixed; border-collapse: collapse; width: 100% !important; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td align="center"><table class="responsive-table tgInner" style="background-color: #ffffff; width: 600px; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgContainer" style="padding: 0 0 0 0;" align="center"><table class="responsive-table tgInner" style="border-collapse: collapse; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="header-image-cell" style="color: rgb(255, 255, 255); width: 600px; min-width: 600px; height: 115px;" align="center"><span class="mcEditImg" style="position: relative;"><img src="https://images.newsletter.ie/nclients/Images/logo-1200xcpy2xcrop1.png" alt="" class="" width="170" height="115" border="0" style="display: block; color: rgb(255, 255, 255); width: 170px; height: 115px; min-width: 170px; max-height: 115px;"></span></td></tr><tr><td class="tgContainer" style="padding: 25px 10px 5px 15px; font-size: 22px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgHeading1" style="position: relative; font-family: Helvetica; font-size: 28px;" spellcheck="false">Sample HTML Message</span></td></tr><tr><td class="tgContainer" style="padding: 15px; font-size: 14px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgBody" style="position: relative; font-family: Helvetica; font-size: 20px; color: rgb(51, 51, 51);" spellcheck="false">This is a text block for your feature article. This text will be the full width of your email and centred. Delete this text and add your own!</span></td></tr><tr><td class="tgContainer"><!-- BUTTON --><table class="mobile-button-container" style="width: 100%;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="padding-copy" style="padding: 15px 0 25px 0;" align="center"><table class="responsive-table tgInner tgButton" style="background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgButtonDef" align="center" style="background-color: rgb(190, 146, 83);"><a class="mcEdit mobile-button" style="font-size: 18px; font-family: Helvetica; font-weight: normal; color: rgb(255, 255, 255); text-decoration: none; background-color: rgb(190, 146, 83); border-width: 15px 25px; border-style: solid; border-color: rgb(190, 146, 83); border-radius: 3px; display: inline-block; position: relative;" spellcheck="false" href="https://sensorpro.net" target="_blank" rel="noopener noreferrer" title="">Find out more ›</a></td></tr></tbody></table></td></tr></tbody></table><!-- END BUTTON --></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>",
    "PlainTextMessage": "Email body if plain text email",
    "MsgType": 0,
    "MailEncoding": "UTF-8",
    "Schedule": {
    "DelayByMinutes": 0,
    "DelayUntilUTC": ""
    }
}'


    OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\r\n        \"From\": {\r\n            \"DisplayName\": \"Marketing\",\r\n            \"Email\": \"richard@sensorpro.net\"\r\n        },\r\n        \"To\": [\r\n            {\r\n            \"DisplayName\": \"\",\r\n            \"Email\": \"rcoady@gmail.com\"\r\n            },\r\n            {\r\n            \"DisplayName\": \"\",\r\n            \"Email\": \"rco.ady@gmail.co\"\r\n            }\r\n        ],\r\n        \"Cc\": [],\r\n        \"Bcc\": [],\r\n        \"Headers\": {},\r\n        \"ReplyTo\": null,\r\n        \"ReturnPath\": null,\r\n        \"Subject\": \"My sample email  😀 \",\r\n        \"HTMLMessageStyle\": \"@import url('https://fonts.googleapis.com/css2?family=Prompt&display=swap');\t@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');         @font-face {             font-family: Futura;             font-weight: 700;             font-style: oblique;             src: url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff"),                  url("https://cdn.jsdelivr.net/npm/futura-font@1.0.0/FuturaBT-Medium.woff") format("woff");        }        /* Force Outlook to provide a "view in browser" message */#outlook a {padding:0;} /* Force width of 100% on main container tables */.ReadMsgBody {width:100% !important;}/* Force Hotmail to display emails at full width */.ExternalClass {width:100%;} /* Force Hotmail to display normal line spacing */.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} body, table, td {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}/* Prevent WebKit and Windows mobile changing default text sizes */a {-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} /* Remove spacing between tables in Outlook 2007 and up */table, td {mso-table-lspace:0pt;mso-table-rspace:0pt;} /* Allow smoother rendering of resized image in Internet Explorer */img {-ms-interpolation-mode:bicubic;} /* RESET STYLES */body {margin:0;padding:0;}img {border:0;height:auto;outline:none;text-decoration:none;}table {border-collapse:collapse !important;}body {height:100% !important;margin:0;padding:0;width:100% !important;min-width:100% !important;}.webversion-link a {color:#777777;}/* iOS BLUE LINKS */.appleBody a {color:#777777;text-decoration: none;}.appleFooter a {color:#777777;text-decoration: none;}.img-mobile {display: none;}/* MOBILE STYLES */@media screen and (max-width: 525px) {/* ALLOWS FOR FLUID TABLES */.wrapper {width:100% !important;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.logo {width: 90%;}/* ADJUSTS LAYOUT OF LOGO IMAGE */.webversion {}/* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */.mobile-hide {display: none !important;}.img-max {max-width: 100% !important;height:auto !important;}.header-image-cell {width: 100% !important; min-width: 100% !important;height: auto !important;}.header-image-cell img {width: 100% !important;min-width: 100% !important; height: auto !important;}.img-mobile {display: block !important;}.img-desktop {display: none !important;}.tgFooterTable {border-right:none!important;}.footerright {text-align:center!important;}.footerleft {text-align:center!important;}/* FULL-WIDTH TABLES */.responsive-table {width:100% !important;min-width: 100% !important;}.tgInner {width:100% !important;}.tgButton {width:100% !important;}.tgBCHeight {width:100% !important;}.tgHeadingBlock {width:100% !important;}.responsive-table-footer {width:100% !important;}.responsive-table-3col {width:100% !important;text-align:center !important;margin-left:auto !important;margin-right:auto !important;}/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */.padding {padding: 10px 5% 15px 5% !important;}.padding-copy {padding: 10px 5% 10px 5% !important;}.padding-meta {padding: 30px 5% 0px 5% !important;text-align: center;}.no-pad {padding: 0 0 20px 0 !important;}.no-padding {padding: 0 !important;}.section-padding {padding: 20px 10px 50px 10px !important;}.section-padding-bottom-image {padding: 50px 15px 0 15px !important;}/* ADJUST BUTTONS ON MOBILE */.mobile-wrapper {padding: 10px 5% 15px 5% !important;}.mobile-button-container {margin:0 auto;width:100% !important;}.mobile-button {width:80% !important;padding: 15px !important;border: 0 !important;font-size: 16px !important;}}\",\r\n        \"HTMLMessageEncoded\": \"<table id="Layout56" class="ReadMsgBody tgOuter" style="table-layout: fixed; border-collapse: collapse; width: 100% !important; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td align="center"><table class="responsive-table tgInner" style="background-color: #ffffff; width: 600px; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgContainer" style="padding: 0 0 0 0;" align="center"><table class="responsive-table tgInner" style="border-collapse: collapse; background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="header-image-cell" style="color: rgb(255, 255, 255); width: 600px; min-width: 600px; height: 115px;" align="center"><span class="mcEditImg" style="position: relative;"><img src="https://images.newsletter.ie/nclients/Images/logo-1200xcpy2xcrop1.png" alt="" class="" width="170" height="115" border="0" style="display: block; color: rgb(255, 255, 255); width: 170px; height: 115px; min-width: 170px; max-height: 115px;"></span></td></tr><tr><td class="tgContainer" style="padding: 25px 10px 5px 15px; font-size: 22px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgHeading1" style="position: relative; font-family: Helvetica; font-size: 28px;" spellcheck="false">Sample HTML Message</span></td></tr><tr><td class="tgContainer" style="padding: 15px; font-size: 14px; font-family: Helvetica, Arial, sans-serif; color: #333333; text-align: center;" valign="top"><span class="mcEdit tgBody" style="position: relative; font-family: Helvetica; font-size: 20px; color: rgb(51, 51, 51);" spellcheck="false">This is a text block for your feature article. This text will be the full width of your email and centred. Delete this text and add your own!</span></td></tr><tr><td class="tgContainer"><!-- BUTTON --><table class="mobile-button-container" style="width: 100%;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="padding-copy" style="padding: 15px 0 25px 0;" align="center"><table class="responsive-table tgInner tgButton" style="background-color: #ffffff;" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td class="tgButtonDef" align="center" style="background-color: rgb(190, 146, 83);"><a class="mcEdit mobile-button" style="font-size: 18px; font-family: Helvetica; font-weight: normal; color: rgb(255, 255, 255); text-decoration: none; background-color: rgb(190, 146, 83); border-width: 15px 25px; border-style: solid; border-color: rgb(190, 146, 83); border-radius: 3px; display: inline-block; position: relative;" spellcheck="false" href="https://sensorpro.net" target="_blank" rel="noopener noreferrer" title="">Find out more ›</a></td></tr></tbody></table></td></tr></tbody></table><!-- END BUTTON --></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>\",\r\n        \"PlainTextMessage\": \"Email body if plain text email\",\r\n        \"MsgType\": 0,\r\n        \"MailEncoding\": \"UTF-8\",\r\n        \"Schedule\": {\r\n            \"DelayByMinutes\": 0,\r\n            \"DelayUntilUTC\": \"\"\r\n        }\r\n    }");
    Request request = new Request.Builder()
    .url("https://apinie.sensorpro.net/api/Email/SendEmail/ae7e0541-e0d5-4c61-ab21-6e7447cbead8")
    .method("POST", body)
    .addHeader("Content-Type", "application/json")
    .build();
    Response response = client.newCall(request).execute();