Already registered? Log in
Please make sure that you have installed MIME::Entity, Net::SMTP_auth and Net::SMTP perl modules.
Please change the following variables in this script:
#!/usr/bin/perl
use MIME::Entity;
use Net::SMTP;
use Net::SMTP_auth;
my $from = 'sender@example.com';
my $to = 'recipient@example.com';
my $subject = 'Your Subject';
my $text_message = "It is a text message n";
my $html_message = "It is a html message";
my $message = MIME::Entity->build (
Type => 'multipart/alternative',
From => $from,
To => $to,
Subject => $subject
);
$message->attach(Type => 'text/plain', Data => $text_message);
$message->attach(Type => 'text/html', Data => $html_message);
my $username = 'USERNAME';
my $password = 'PASSWORD';
my $smtp;
if (not $smtp = Net::SMTP->new('mail.smtp2go.com',
Port => 2525, # 8025, 587 and 25 can also be used.
Timeout => 30)) {
die "Could not connect to servern";
}
$smtp->auth($username, $password) || die "Authentication failed! n";
$smtp->mail($from);
$smtp->to($to);
$smtp->data($message->as_string);
$smtp->quit;
Try SMTP2GO free for as long as you like:
Try SMTP2GO Free → Paid plans available for over 1,000 emails/month.