{"id":727,"date":"2024-03-27T16:13:11","date_gmt":"2024-03-27T16:13:11","guid":{"rendered":"https:\/\/www.graphicz.co.uk\/blog\/?p=727"},"modified":"2024-03-29T08:25:47","modified_gmt":"2024-03-29T08:25:47","slug":"editing-sellerdeck-smtplibrary-pm-to-ensure-email-deliverability","status":"publish","type":"post","link":"https:\/\/www.graphicz.co.uk\/blog\/editing-sellerdeck-smtplibrary-pm-to-ensure-email-deliverability\/","title":{"rendered":"Editing Sellerdeck SMTPLibrary.pm to ensure email deliverability"},"content":{"rendered":"\n<p>Emails being sent out from Sellerdeck can be blocked and &#8216;non-delivered&#8217; because the Message ID and MIME Type are missing from the email headers. Apparently this problem can be resolved by adding a line and some code to the SMPTLibrary.pm script. <\/p>\n\n\n\n<p>In the Site folder find SMPTLibrary.pm and right click copy and paste so you have a backup.<\/p>\n\n\n\n<p>Open the original SMPTLibrary.pm in a text editor such as Notepad or Notepad++ (do not use a word processor application) and look at line 489:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> my $mail_headers = \"From: $mail_from\\n\".\n\"To: $mail_to\\n\".\n\"Reply-to: $mail_replyTo\\n\".\n\"Subject: \".encode('MIME-Header', $mail_subject).\"\\n\".\n\"Date: $sNow\\n\";\n\"MIME-Version: 1.0\\n\";<\/pre>\n\n\n\n<p>Change this to:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> my $mail_headers = \"From: $mail_from\\n\".\n\"To: $mail_to\\n\".\n\"Reply-to: $mail_replyTo\\n\".\n\"Subject: \".encode('MIME-Header', $mail_subject).\"\\n\".\n\"Date: $sNow\\n\".\n\"Message-Id: \" . create_mid().\"\\n\".\n\"MIME-Version: 1.0\\n\";<\/pre>\n\n\n\n<p><em><strong>Note that&nbsp;&#8220;Date: $sNow\\n&#8221;;&nbsp;is different to&nbsp;&#8220;Date: $sNow\\n&#8221;.<\/strong><\/em><\/p>\n\n\n\n<p>AT the very bottom of SMPTLibrary.pm replace:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">}\n1;<\/pre>\n\n\n\n<p>with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> }\n\n# Code derived from Email::MessageID 1.406 by Ricardo Signes\n# http:\/\/cpansearch.perl.org\/src\/RJBS\/Email-MessageID-1.406\/lib\/Email\/MessageID.pm\nuse Sys::Hostname qw\/hostname\/;\nmy @CHARS = ('A'..'F','a'..'f',0..9);\nmy %uniq;\nsub create_mid {\nmy $noise = join '',\nmap {; $CHARS[rand @CHARS] } (0 .. (3 + int rand 6));\nmy $t = time;\nmy $u = exists $uniq{$t} ? ++$uniq{$t} : (%uniq = ($t => 0))[1];\nmy $user = join '.', $t . $u, $noise, $$;\nreturn '&lt;' . $user . '@' . hostname . '>';\n}\n\n1;<\/pre>\n\n\n\n<p>Save the file and in Sellerdeck do Web, Refresh website.<\/p>\n\n\n\n<p>Do a test contact us email and a test order. You will now find these emails are being correctly delivered.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Emails being sent out from Sellerdeck can be blocked and &#8216;non-delivered&#8217; because the Message ID and MIME Type are missing from the email headers. Apparently this problem can be resolved by adding a line and some code to the SMPTLibrary.pm<span class=\"ellipsis\">&hellip;<\/span> <a href=\"https:\/\/www.graphicz.co.uk\/blog\/editing-sellerdeck-smtplibrary-pm-to-ensure-email-deliverability\/\"><\/p>\n<div class=\"read-more\"><b>Read more &#8250;<\/b><\/div>\n<p><!-- end of .read-more --><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-727","post","type-post","status-publish","format-standard","hentry","category-graphicz-articles"],"_links":{"self":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/727"}],"collection":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=727"}],"version-history":[{"count":3,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/727\/revisions"}],"predecessor-version":[{"id":731,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/727\/revisions\/731"}],"wp:attachment":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}