File: send-ssl-mail.pl

package info (click to toggle)
libnet-sslglue-perl 1.058-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 212 kB
  • sloc: perl: 825; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;

use Net::SSLGlue::SMTP;
my $smtp = Net::SMTP->new( 'mail.gmx.net', 
	SSL => 1, 
	SSL_ca_path => "/etc/ssl/certs",
	Debug => 1 
) or die $@;
die $smtp->peerhost.':'.$smtp->peerport;
$smtp->auth( '123456','password' );
$smtp->mail( 'me@example.org' );
$smtp->to( 'you@example.org' );
$smtp->data;
$smtp->datasend( <<EOD );
From: me
To: you
Subject: test test

lalaal
EOD
$smtp->dataend;
$smtp->quit;