send email with perl 587 and startssl
am 23.07.2011 03:19:03 von ML--nextPart6419020.LyC7RbHGOo
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
hello folks
when is it the easiest solution to email 587 startssl and authentication
I arrived by writing this but the email sent does not contain the headers o=
f=20
the authentication
]$ cat emailsender1.pl
#!/usr/bin/perl
use Email::MIME;
my $message =3D Email::MIME->create(
header =3D> [
From =3D> 'titi@titi.eu',
To =3D> 'toto@toto.fr',
],
parts =3D> [
q[ This is part one],
q[ This is part two],
q[ These could be binary too],
],
);
# produce an Email::Abstract compatible message object,
# e.g. produced by Email::Simple, Email::MIME, Email::Stuff
use Email::Sender::Simple qw(sendmail);
use Email::Sender::Transport::SMTP qw();
use Try::Tiny;
my $SMTP_ENVELOPE_FROM_ADDRESS=3D'titi@titi.eu';
my $SMTP_HOSTNAME=3D'smtp.titi.eu';
my $SMTP_PORT=3D587;
try {
sendmail(
$message,
{
from =3D> $SMTP_ENVELOPE_FROM_ADDRESS,
transport =3D> Email::Sender::Transport::SMTP->new({
host =3D> $SMTP_HOSTNAME,
port =3D> $SMTP_PORT,
})
}
);
} catch {
warn "sending failed: $_";
};
=2D-=20
=A0http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0x0 92164A7
=A0gpg --keyserver pgp.mit.edu --recv-key 092164A7
--nextPart6419020.LyC7RbHGOo
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD4DBQBOKiGPtXI/OwkhZKcRAnpmAJjeSbLEfvpnPej/+aJfK9Koo7KYAJ9E LhTO
Sp4aS4lD8o8pH5WN0o4GVg==
=b2AH
-----END PGP SIGNATURE-----
--nextPart6419020.LyC7RbHGOo--