{"id":568,"date":"2012-06-03T00:04:00","date_gmt":"2012-06-03T07:04:00","guid":{"rendered":"https:\/\/kb.terabyteunlimited.com\/kb-articles\/sending-emails-from-image-for-windows-v2-to-servers-that-require-ssl\/"},"modified":"2022-11-18T21:39:46","modified_gmt":"2022-11-19T05:39:46","slug":"sending-emails-from-image-for-windows-v2-to-servers-that-require-ssl","status":"publish","type":"lsvr_kba","link":"https:\/\/www.terabyteunlimited.com\/kb\/kb-articles\/sending-emails-from-image-for-windows-v2-to-servers-that-require-ssl\/","title":{"rendered":"Sending Emails from Image for Windows V2 to Servers that Require SSL"},"content":{"rendered":"<p><strong>Note:<\/strong> Image for Windows V3 includes native support for sending emails to servers that use SSL and TLS.<\/p>\r\n  <p><strong><font color=\"#ff5500\">Problem:<\/font><\/strong> <\/p>\r\n  <p>Image for Windows (IFW)&nbsp;V2 does not natively support sending emails to a server that requires SSL. Doing so results in an error when IFW attempts to send the email.<\/p>\r\n  <p><strong><font color=\"#ff5500\">Solution:<\/font><\/strong><\/p>\r\n  <p>Sending emails from Image for Windows to servers that require SSL (such as <strong>smtp.gmail.com<\/strong>) can be accomplished by using the <strong>stunnel<\/strong> program. <\/p>\r\n  <p><strong>Instructions:<\/strong><\/p>\r\n  <ol>\r\n    <li>Download <strong>stunnel<\/strong> from <a href=\"http:\/\/www.stunnel.org\/?page=downloads\" target=\"_blank\" rel=\"noopener\">www.stunnel.org<\/a>. Select an appropriate download site and then select the installer (e.g. <font color=\"#226622\">stunnel-4.53-installer.exe<\/font>).<br \/><br \/><\/li>\r\n    <li>Run the installer to install stunnel on the system. The default installation path is in the <font color=\"#226622\">C:&#92;Program Files<\/font> or <font color=\"#226622\">C:&#92;Program Files (x86)<\/font> folder. Depending on your version of Windows, you many want to install to a non-system folder to provide easier access to the program and its files (e.g. <font color=\"#226622\">C:&#92;stunnel<\/font>). Select the desired components to install (for normal email sending with IFW it's not necessary to install the <em>Self-signed Certificate Tools<\/em> component). Creating the program shortcuts is recommended to allow easy access to the program.<br \/><br \/><\/li>\r\n    <li>Before running stunnel it's necessary to edit its configuration file. Note that if you installed to the default location you may need administrator privileges to edit and save&nbsp;the file. Use Explorer (or the Command Prompt) and navigate to the installation folder. Edit the <strong>stunnel.conf<\/strong> file (e.g. from the Command Prompt, run <font color=\"#226622\">notepad stunnel.conf<\/font>). Make the following changes to the file:<br \/><br \/>\r\n      <ul>\r\n        <li>Note: To comment out a line, place a semi-colon at the start of the line. <\/li>\r\n        <li>Comment out the following line (located about 22 lines down): <font color=\"#226622\">cert = stunnel.pem<\/font> <\/li>\r\n        <li>Scroll down a little further to the <em>Service definitions<\/em> section and comment out the entire <strong>[pop3s]<\/strong>, <strong>[imaps]<\/strong>, and <strong>[ssmtp]<\/strong> sections (each section has three lines to comment out). <\/li>\r\n        <li>Scroll down a little further and uncomment the <strong>[gmail-smtp] <\/strong>section (remove the semi-colon from the beginning of all four lines). <\/li>\r\n        <li>Still in the <strong>[gmail-smtp]<\/strong> section, change the incoming port number to the one you want to use when sending from IFW. In this example, port <strong>259<\/strong> will be used. The entire <strong>[gmail-smtp]<\/strong> section will then be as follows:<br \/><font color=\"#226622\">[gmail-smtp]client = yes<br \/>accept = 127.0.0.1:<strong>259<\/strong><br \/>connect = smtp.gmail.com:465<\/font> <\/li>\r\n        <li>Save the changes to the file and exit Notepad.<br \/><br \/><\/li>\r\n      <\/ul>\r\n    <\/li>\r\n    <li>Run <strong>stunnel<\/strong>. This can be done using the Desktop shortcut or from the Programs menu. The program will be accessible from its tray icon.<br \/><br \/><\/li>\r\n    <li>Configure the IFW command line to send the email using the port specified in the stunnel.conf file. For example (the following should all be on one line):<br \/><font color=\"#226622\">&quot;&#92;Program Files (x86)&#92;TeraByte Unlimited&#92;Image for Windows&#92;V2&#92;imagew.exe&quot; \/b \/uy \/d:w0@0x1 \/f:&quot;e:&#92;Backups&#92;Windows7&quot; <br \/>\r\n    \/email:localhost*<strong>from_email@gmail.com<\/strong>*to_email@domain.com*&quot;Subject: IFW Operation (~ec~)&quot;*<strong>259<\/strong>*<strong>from_email@gmail.com<\/strong>*<em>password<\/em><\/font><br \/><br \/>&quot;from_email@gmail.com&quot; would be the gmail account's address (e.g. johnsmith@gmail.com). <br \/>&quot;password&quot; would be the gmail account's password (or the cached password, if using that feature of IFW).<br \/><br \/>This example shows using a cached password, <em>MyEmailPassword<\/em> (the following should all be on one line):<br \/><font color=\"#226622\">&quot;&#92;Program Files (x86)&#92;TeraByte Unlimited&#92;Image for Windows&#92;V2&#92;imagew.exe&quot; \/b \/uy \/d:w0@0x1 \/f:&quot;e:&#92;Backups&#92;Windows7&quot; <br \/>\r\n    \/email:localhost*<strong>from_email@gmail.com<\/strong>*to_email@domain.com*&quot;Subject: IFW Operation (~ec~)&quot;*<strong>259<\/strong>*<strong>from_email@gmail.com<\/strong>*{#MyEmailPassword#}<\/font><br \/><br \/><br \/><\/li>\r\n    <li>Run the IFW operation and test that the email is sent properly. <\/li>\r\n  <\/ol>\r\n  <p>&nbsp;<\/p><hr \/>\r\n  <p><strong><font color=\"#ff5500\">Technical Notes:<\/font><\/strong><br \/><\/p>\r\n  <ul>\r\n    <li>Email settings can be configured in the IFW.INI file if not wanted on the command line. This stops the email log in information from being displayed in the email's text. Alternatively, the email password can be cached by IFW.<br \/><br \/><\/li>\r\n    <li>If desired, stunnel can be configured to run as a service (these options are available in stunnel's Start Menu shortcuts).<br \/><br \/><\/li>\r\n    <li>Documentation for stunnel can be found here: <a href=\"http:\/\/www.stunnel.org\/?page=docs\" target=\"_blank\" rel=\"noopener\">http:\/\/www.stunnel.org\/?page=docs<\/a> <\/li>\r\n  <\/ul>","protected":false},"excerpt":{"rendered":"<p>Note: Image for Windows V3 includes native support for sending emails to servers that use SSL and TLS. Problem: Image for Windows (IFW)&nbsp;V2 does not natively support sending emails to a server that requires SSL. Doing so results in an error when IFW attempts to send the email. Solution: Sending emails from Image for Windows [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"lsvr_kba_cat":[2190],"lsvr_kba_tag":[2121],"class_list":["post-568","lsvr_kba","type-lsvr_kba","status-publish","hentry","lsvr_kba_cat-ifd-ifl-ifw-version-2-archive","lsvr_kba_tag-image-for-windows"],"_links":{"self":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/comments?post=568"}],"version-history":[{"count":1,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/568\/revisions"}],"predecessor-version":[{"id":6367,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/568\/revisions\/6367"}],"wp:attachment":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/media?parent=568"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_cat?post=568"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_tag?post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}