{"id":4916,"date":"2013-05-28T08:54:43","date_gmt":"2013-05-28T07:54:43","guid":{"rendered":"https:\/\/blogs.mentor.com\/colinwalls\/?p=4916"},"modified":"2026-03-26T16:40:41","modified_gmt":"2026-03-26T20:40:41","slug":"using-an-smtp-client","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/embedded-software\/2013\/05\/28\/using-an-smtp-client\/","title":{"rendered":"Using an SMTP client"},"content":{"rendered":"<p>I always find it satisfying to see simple solutions to apparently complex problems and the world of embedded software certainly lends itself to some creativity. My concept of &#8220;simple&#8221; is quite broad, but essentially encompasses anything that is easy to understand [for me] and ideally avoids reinvention of any wheels.<\/p>\n<p>A while ago, I wrote about <a href=\"https:\/\/blogs.mentor.com\/colinwalls\/blog\/2012\/04\/30\/who-needs-a-web-server\/\" target=\"_blank\" rel=\"noopener noreferrer\">incorporating a Web server<\/a> [HTTP server actually] into an embedded device so that information might be displayed on any connected Web browser. Along the same lines, I have been thinking about using email &#8230;<!--more--><\/p>\n<p>When I talked about adding a Web server to an embedded device, I was not suggesting that the device in question actually hosted a publicly accessible website. The idea was to simply leverage Web technology. Web pages &#8211; HTML etc. &#8211; is easy enough to use to create a user interface; the HTTP protocol is straightforward to handle; Web server software is readily available for most real time operating systems, including <a href=\"http:\/\/www.mentor.com\/embedded-software\/nucleus\/\" target=\"_blank\" rel=\"noopener noreferrer\">Nucleus<\/a>, of course. The result is a powerful and readily maintainable UI solution with minimal coding.<\/p>\n<p>We can apply the same philosophy to the use of email. I am not, of course, suggesting that a device have an email account so that it can keep in touch with its friends and relations. I am talking about the leveraging of technology. Imagine a device that needs to periodically send [and\/or perhaps receive] modest amounts of data to a remote location and it is connected [at least some of the time] to the Internet. A possible example might be a WiFi enabled vital signs monitor worn at all times by a chronically ill patient; it might send a set or readings to the hospital periodically or when there is a significant change.<\/p>\n<p>Although there are a number email protocols in use, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Simple_Mail_Transfer_Protocol\" target=\"_blank\" rel=\"noopener noreferrer\">Simple Mail Transfer Protocol<\/a> [SMTP] is very common and widely understood, as it has been in use since the earliest days of the Internet. SMTP is normally only used for sending emails &#8211; the sender needs to have SMTP client software and the mailer server will have an SMTP server. Other email protocols in use include Post Office Protocol [POP3], which is complementary to SMTP and used to receive email, and the Internet Message Access Protocol [IMAP], which provides more sophisticated capabilities.<a href=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2013\/05\/SMTP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-4920\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2013\/05\/SMTP-520x174.png\" alt=\"\" width=\"520\" height=\"174\" \/><\/a><\/p>\n<p>SMTP is a simple, text based protocol, which really only uses 3 types of message [MAIL, RCPT and DATA]. It is, therefore, easy to apply and monitor\/debug. An SMTP client can be [and usually is] very light weight and readily available for many popular RTOSes, like <a href=\"http:\/\/www.mentor.com\/embedded-software\/nucleus\/\" target=\"_blank\" rel=\"noopener noreferrer\">Nucleus<\/a>. The simplicity is attractive because it minimizes development time. The small size is useful for many embedded devices where memory is at a premium, but is also a benefit for applications [like medical devices] where certification is required &#8211; less code = cheaper certification.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I always find it satisfying to see simple solutions to apparently complex problems and the world of embedded software certainly&#8230;<\/p>\n","protected":false},"author":71677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[300,303,304,374,526,309,527,311],"industry":[],"product":[],"coauthors":[],"class_list":["post-4916","post","type-post","status-publish","format-standard","hentry","category-news","tag-embedded-software","tag-medical","tag-nucleus","tag-nucleus-os","tag-pop3","tag-rtos","tag-smtp","tag-tcpip"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/4916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/users\/71677"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/comments?post=4916"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/4916\/revisions"}],"predecessor-version":[{"id":10174,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/4916\/revisions\/10174"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/media?parent=4916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/categories?post=4916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/tags?post=4916"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/industry?post=4916"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/product?post=4916"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/coauthors?post=4916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}