{"id":1331,"date":"2012-01-29T21:52:09","date_gmt":"2012-01-29T19:52:09","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1331"},"modified":"2012-02-04T00:49:15","modified_gmt":"2012-02-03T22:49:15","slug":"utility-clearance-simple-smtp-email-sender","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1331","title":{"rendered":"Utility Clearance: Simple SMTP Email Sender"},"content":{"rendered":"<p>The library implements SMTP client and exposes a simple COM interface to send emails. The interface is simple and straightforward, and the emails can be send from various environments, including such as JavaScript code. The class supports SSL\/TLS security and is GMail compliant.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1332\" title=\"Alax.Info Email Tools 1.0 Type Library\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2012\/01\/Image001.png\" alt=\"\" width=\"523\" height=\"479\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2012\/01\/Image001.png 523w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2012\/01\/Image001-320x293.png 320w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/p>\n<p>A JScript code snippet below provides a sample use case:<\/p>\n<pre style=\"color: #000000; background: #ffffff;\">message <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000; font-weight: bold;\">new<\/span> <span style=\"color: #797997;\">ActiveXObject<\/span><span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">AlaxInfo.EmailTools.Message<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>ServerHost <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">mail.alax.info<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/message.ServerPort = 25;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Sender <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Sender &lt;test@alax.info&gt;<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>ToRecipients <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Recipient &lt;address@gmail.com&gt;<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/message.CcRecipients = \"\";<\/span>\r\n<span style=\"color: #696969;\">\/\/message.BccRecipients = \"\";<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Subject <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Message Test (Plain)<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Body <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">This is an e-mail message test:<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">- Security: None<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">- Authentication: Plain Text (PLAIN)<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>AuthMethods <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">plain<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>AuthName <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">test@alax.info<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>AuthPassword <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">12345678<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Send<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span><\/pre>\n<p>The capabilities include:<\/p>\n<ul>\n<li>No additional dependencies &#8211; regsvr32 the DLL and it&#8217;s ready to use; SSL\/TLS implementation through <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa374782%28v=vs.85%29.aspx\">SChannel API<\/a><\/li>\n<li>UTF-8 encoding and support for Unicode and international characters<\/li>\n<li>Secure SSL connections (<strong>SecureSocketsLayer<\/strong> property)<\/li>\n<li>Secure Transport Layer Security (TLS) connections with <strong>STARTTLS<\/strong> command (<strong>TransportLayerSecurity<\/strong> property)<\/li>\n<li>Authentication options: plain text (LOGIN, PLAIN), digest (CRAM-MD5)<\/li>\n<li>Protocol References:<\/li>\n<ul>\n<li><a href=\"http:\/\/tools.ietf.org\/html\/rfc5321\">RFC 5321 &#8211; Simple Mail Transfer Protocol<\/a><\/li>\n<li><a href=\"http:\/\/tools.ietf.org\/html\/rfc2045\">RFC 2045 &#8211; Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies<\/a><\/li>\n<li><a href=\"http:\/\/tools.ietf.org\/html\/rfc3207\">RFC 3207 &#8211; SMTP Service Extension for Secure SMTP over Transport Layer Security<\/a><\/li>\n<li><a href=\"http:\/\/tools.ietf.org\/html\/rfc2195\">RFC 2195 &#8211; IMAP\/POP AUTHorize Extension for Simple Challenge\/Response<\/a><\/li>\n<li><a href=\"http:\/\/tools.ietf.org\/html\/rfc4616\">RFC 4616 &#8211; The PLAIN Simple Authentication and Security Layer (SASL) Mechanism<\/a><\/li>\n<\/ul>\n<\/ul>\n<p><!--more--><\/p>\n<p>Relaying through Google Mail needs secure connection (SSL or TLS) plus plain text authentication of sender:<\/p>\n<pre style=\"color: #000000; background: #ffffff;\">message <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000; font-weight: bold;\">new<\/span> <span style=\"color: #797997;\">ActiveXObject<\/span><span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">AlaxInfo.EmailTools.Message<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>ServerHost <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">smtp.gmail.com<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/message.ServerPort = 587;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Sender <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Sender &lt;foo+sender@gmail.com&gt;<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>ToRecipients <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Recipient &lt;bar+receiver@gmail.com&gt;<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/message.CcRecipients = \"\";<\/span>\r\n<span style=\"color: #696969;\">\/\/message.BccRecipients = \"\";<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Subject <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Message Test (TLS, Plain)<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Body <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">This is an e-mail message test:<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">- Security: TLS<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">- Authentication: Plain Text (PLAIN)<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">\\r<\/span><span style=\"color: #0f69ff;\">\\n<\/span><span style=\"color: #800000;\">\"<\/span> <span style=\"color: #808030;\">+<\/span>\r\n  <span style=\"color: #800000;\">\"<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>TransportLayerSecurity <span style=\"color: #808030;\">=<\/span> <span style=\"color: #0f4d75;\">true<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>AuthMethods <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">plain<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>AuthName <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">foo@gmail.com<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>AuthPassword <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">password<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Send<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span><\/pre>\n<h4>Download Information<\/h4>\n<ul>\n<li>Download (32-bit): <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/Utilities\/EmailTools\/Win32\/\">EmailTools.dll<\/a><\/li>\n<li>Download (64-bit): <a href=\"https:\/\/www.alax.info\/svn\/public\/trunk\/Utilities\/EmailTools\/x64\/\">EmailTools.dll<\/a><\/li>\n<li>License: This software is free to use<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The library implements SMTP client and exposes a simple COM interface to send emails. The interface is simple and straightforward, and the emails can be send from various environments, including such as JavaScript code. The class supports SSL\/TLS security and is GMail compliant. A JScript code snippet below provides a sample use case: message =&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1331\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[95,399,235,400,68,402,401,398],"class_list":["post-1331","post","type-post","status-publish","format-standard","hentry","category-utilities","tag-com","tag-email","tag-message","tag-schannel","tag-smtp","tag-ssl","tag-tls","tag-utilitiy"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1331"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1331\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}