{"id":1357,"date":"2012-04-28T19:45:37","date_gmt":"2012-04-28T17:45:37","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1357"},"modified":"2012-04-28T09:00:48","modified_gmt":"2012-04-28T07:00:48","slug":"com-class-to-send-smtp-email-x64-attachments-html-content-type","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1357","title":{"rendered":"COM Class to Send SMTP Email: x64, Attachments, HTML Content-Type"},"content":{"rendered":"<p>Here go the updates on the COM library which offers <a href=\"https:\/\/alax.info\/blog\/1331\">easy to use COM interface to send emails<\/a>, including over secure TLS and SSL channels:<\/p>\n<ul>\n<li><code>x64<\/code> build<\/li>\n<li><code>Attachments<\/code> property to enable attchments to the message being sent<\/li>\n<li><code>ContentType<\/code> property to enable <code>text\/html<\/code> bodies<\/li>\n<li>subject non-English characters are correctly <code>UTF-8<\/code> encoded<\/li>\n<li>empty <code>To<\/code>, <code>CC<\/code>, <code>BCC<\/code> fields are discarded<\/li>\n<li>recent properties are put onto persistence map: <code>SecureSocketsLayer<\/code>, <code>TransportLayerSecurity<\/code>, <code>ContentType<\/code><\/li>\n<\/ul>\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\r\n<span style=\"color: #696969;\">\/\/ ...<\/span>\r\nmessage<span style=\"color: #808030;\">.<\/span>Body <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">See attached.<\/span><span style=\"color: #800000;\">\"<\/span>\r\n\r\nattachment <span style=\"color: #808030;\">=<\/span> message<span style=\"color: #808030;\">.<\/span>Attachments<span style=\"color: #808030;\">.<\/span>Add<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>Type <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">text\/html<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>Disposition <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">attachment<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>Name <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">AutoBuildResults.html<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>LoadFromFile<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">C:<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">AutoBuildResults.html<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n\r\nattachment <span style=\"color: #808030;\">=<\/span> message<span style=\"color: #808030;\">.<\/span>Attachments<span style=\"color: #808030;\">.<\/span>Add<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>Type <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">image\/jpeg<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #696969;\">\/\/attachment.Disposition = \"inline\";<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>Name <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">picture.jpg<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #800080;\">;<\/span>\r\nattachment<span style=\"color: #808030;\">.<\/span>LoadFromFile<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">C:<\/span><span style=\"color: #0f69ff;\">\\\\<\/span><span style=\"color: #0000e6;\">me.jpg<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n\r\n<span style=\"color: #696969;\">\/\/ ...<\/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>Here go the updates on the COM library which offers easy to use COM interface to send emails, including over secure TLS and SSL channels: x64 build Attachments property to enable attchments to the message being sent ContentType property to enable text\/html bodies subject non-English characters are correctly UTF-8 encoded empty To, CC, BCC fields&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1357\">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":[11,2],"tags":[95,399,235,68,402,401,398],"class_list":["post-1357","post","type-post","status-publish","format-standard","hentry","category-atl","category-utilities","tag-com","tag-email","tag-message","tag-smtp","tag-ssl","tag-tls","tag-utilitiy"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1357","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=1357"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1357\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}