{"id":390,"date":"2010-06-29T16:17:28","date_gmt":"2010-06-29T23:17:28","guid":{"rendered":"http:\/\/45.63.48.66\/?p=390"},"modified":"2010-06-30T12:13:49","modified_gmt":"2010-06-30T19:13:49","slug":"smtp-mail-functionality-in-pre-dynamics-nav-5-version","status":"publish","type":"post","link":"https:\/\/gotcal.com\/index.php\/2010\/06\/smtp-mail-functionality-in-pre-dynamics-nav-5-version\/","title":{"rendered":"SMTP Mail functionality in Pre Dynamics NAV 5 versions"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-389\" title=\"062910_2317_SMTPMailfun1.png\" src=\"http:\/\/45.63.48.66\/wp-content\/uploads\/2010\/06\/062910_2317_SMTPMailfun1-300x236.png\" alt=\"\" width=\"300\" height=\"236\" srcset=\"https:\/\/gotcal.com\/wp-content\/uploads\/2010\/06\/062910_2317_SMTPMailfun1-300x236.png 300w, https:\/\/gotcal.com\/wp-content\/uploads\/2010\/06\/062910_2317_SMTPMailfun1.png 487w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>Just a quick post here serving as shortcut for implementing Microsoft Navision Mail.SmtpMessage in older databases. All it requires is these objects:<\/p>\n<ul>\n<li>Table 409 SMTP Mail<span style=\"font-family: Times New Roman; font-size: 12pt;\"><br \/>\n<\/span><\/li>\n<li>Form 409 SMTP Mail<\/li>\n<li>\n<div>Codeunit 400 SMTP Mail<\/div>\n<p><!--more--><\/li>\n<\/ul>\n<p>And of course an updated license file for the customer, that adds the permissions for the new 5.0 objects. If they are not on the v5 executables they also need to install the &#8220;Microsoft.Navision.Mail.dll&#8221; automation control. I have created a small package here that is a selfextracting rar file, that automatically installs the component into the Global Assembly Cache.<\/p>\n<p>Here are the objects (from 5.0SP1):<\/p>\n<p>[dm]6[\/dm]<\/p>\n<p>And the Mail automation installer:<br \/>\n[dm]5[\/dm]<\/p>\n<p>Usage is very simple:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nSMTP.CreateMessage(SenderName,SenderAddress,Recipients,Subject,Body,HtmlFormatted);\r\nSMTP.Send();\r\n<\/pre>\n<p>you will see methods for AddRecipients, AddCC, AddBCC, AppendBody and AddAttachment. The component also supports HTML in the body section.<\/p>\n<p><em><strong>Update 6\/29\/2010:<\/strong><\/em><\/p>\n<p>I just received a message from my danish colleague Steffen Brandt, that a hotfix is available from Microsoft, that allows you to change the standard SMTP port 25. The <a href=\"https:\/\/mbs.microsoft.com\/knowledgebase\/KbDisplay.aspx?scid=kb;EN-US;981354\">KB981354<\/a> has the information. I will update the download section tomorrow, so it has the latest DLL&#8217;s and fob&#8217;s.<\/p>\n<p>Hotfix code changes:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ufeffAdd column 6 in the SMTP Mail Setup table(409) as follow:\r\n\r\n...\r\n{ 6   ;   ;SMTP Server Port    ;Integer       ;InitValue=25; }\r\n...\r\n\r\n4.\tAdd the SMTP Server Port field in the SMTP Mail Setup form(409) as follow:\r\n\r\n...\r\n{ 14  ;TextBox      ;3850 ;1540 ;5500 ;440  ;Name=&lt;SMTP Server Port&gt;;\r\n                                                 ParentControl=1;\r\n                                                 InPage=0;\r\n                                                 DecimalPlaces=0:0;\r\n                                                 NotBlank=Yes;\r\n                                                 Numeric=Yes;\r\n                                                 SourceExpr=&quot;SMTP Server Port&quot;;\r\n                                                 MinValue=1 }\r\n    { 15  ;Label        ;440  ;1540 ;3300 ;440  ;ParentControl=14; }\r\n...\r\n\r\n5.\tChange the code in the SMTP Mail codeunit(400) as follows:\r\nExisting code 1\r\n\r\n...\r\n      Mail@1000 : Automation &quot;{68AEAA7B-9523-3511-AF5F-F2381D2C6F04} 1.0:{F9DAE2A4-D2F8-37C3-86D5-E4FFE166D860}:'Microsoft Navision Mail'.SmtpMessage&quot;;\r\n...\r\n\r\nReplacement code 1\r\n\r\n...\r\n      Mail@1000 : Automation &quot;{68AEAA7B-9523-3511-AF5F-F2381D2C6F04} 7.0:{F9DAE2A4-D2F8-37C3-86D5-E4FFE166D860}:'Microsoft Navision Mail'.SmtpMessage&quot;;\r\n...\r\n\r\n\r\n\r\nExisting code 2\r\n\r\n...\r\n                Mail.Send(\r\n            &quot;SMTP Server&quot;,Authentication &lt;&gt; SMTPMailSetup.Authentication::Anonymous,&quot;User ID&quot;, Password);\r\n...\r\n\r\nReplacement code 2\r\n\r\n...\r\n                Mail.Send(\r\n            &quot;SMTP Server&quot;,Authentication &lt;&gt; Authentication::Anonymous,&quot;User ID&quot;,Password,&quot;SMTP Server Port&quot;);\r\n...\r\n<\/pre>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Just a quick post here serving as shortcut for implementing Microsoft Navision Mail.SmtpMessage in older databases. All it requires is these objects: Table 409 SMTP Mail Form 409 SMTP Mail Codeunit 400 SMTP Mail<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[30,77,28,27,8,7,36,25],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-navision","tag-automation","tag-navision","tag-external","tag-how-to","tag-license","tag-objects","tag-smtp","tag-upgrade"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":12,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/390\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}