Closed djstevenson closed 4 years ago
The following test script shows how I can send mail that should work both on dev mac and on deployment Linode. Obvs the credentials will be set by something that's not in the repo, e.g. ENV vars:
#!/usr/bin/env perl
use strict;
use warnings;
use Net::SMTP::TLS;
my $smtp = Net::SMTP::TLS->new(
'xxxx', # SMTP server
NoTLS => 1,
Hello => 'songstothesiren.com',
Timeout =>60,
User => 'xxxx', # auth user for SMTP server
Password => 'xxxx', # auth pw for SMTP server
);
my $from = 'noreply@songstothesiren.com';
my $to = 'xxx@example.com',
$smtp->mail($from);
$smtp->recipient($to);
$smtp->data;
$smtp->datasend("From: ${from}\n");
$smtp->datasend("To: ${to}\n");
$smtp->datasend("Subject: This is a test\n\n");
$smtp->datasend("blahblah etc\n");
$smtp->dataend;
$smtp->quit;
Done in PRs #234 and #235
Deliver emails by some method that doesn't cost money (Mailgun is dropping the free tier).