Editing Sellerdeck SMTPLibrary.pm to ensure email deliverability

Call 01323 872296


Editing Sellerdeck SMTPLibrary.pm to ensure email deliverability

Emails being sent out from Sellerdeck can be blocked and ‘non-delivered’ 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.

In the Site folder find SMPTLibrary.pm and right click copy and paste so you have a backup.

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:

 my $mail_headers = "From: $mail_from\n".
"To: $mail_to\n".
"Reply-to: $mail_replyTo\n".
"Subject: ".encode('MIME-Header', $mail_subject)."\n".
"Date: $sNow\n";
"MIME-Version: 1.0\n";

Change this to:

 my $mail_headers = "From: $mail_from\n".
"To: $mail_to\n".
"Reply-to: $mail_replyTo\n".
"Subject: ".encode('MIME-Header', $mail_subject)."\n".
"Date: $sNow\n".
"Message-Id: " . create_mid()."\n".
"MIME-Version: 1.0\n";

Note that “Date: $sNow\n”; is different to “Date: $sNow\n”.

AT the very bottom of SMPTLibrary.pm replace:

}
1;

with

 }

# Code derived from Email::MessageID 1.406 by Ricardo Signes
# http://cpansearch.perl.org/src/RJBS/Email-MessageID-1.406/lib/Email/MessageID.pm
use Sys::Hostname qw/hostname/;
my @CHARS = ('A'..'F','a'..'f',0..9);
my %uniq;
sub create_mid {
my $noise = join '',
map {; $CHARS[rand @CHARS] } (0 .. (3 + int rand 6));
my $t = time;
my $u = exists $uniq{$t} ? ++$uniq{$t} : (%uniq = ($t => 0))[1];
my $user = join '.', $t . $u, $noise, $$;
return '<' . $user . '@' . hostname . '>';
}

1;

Save the file and in Sellerdeck do Web, Refresh website.

Do a test contact us email and a test order. You will now find these emails are being correctly delivered.

Keep in touch and share

Graphicz on Social Media



01323 872296. 07836 551000.
Email:

Website by Graphicz