-
Dariusz Janny authoredDariusz Janny authored
send.pl 716 B
#! /usr/bin/perl
use warnings;
use strict;
use Net::SMTP;
my $smtpserver = 'localhost';
my $smtpport = 9025;
my $smtpuser = 'postfix';
my $smtppassword = '';
#my $to = 'janny@man.poznan.pl';
my $to = 'dariusz.janny@gmail.com';
my $from = 'janny@man.poznan.pl';
my $subject = 'subject no 2';
my $smtp = Net::SMTP->new($smtpserver, Port=>$smtpport, Timeout => 10, Debug => 1);
die "Could not connect to server!\n" unless $smtp;
# $smtp->auth($smtpuser, $smtppassword);
$smtp ->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend("From: $from\n");
$smtp->datasend("To: $to\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("\n");
$smtp->datasend("abc test\n");
$smtp->dataend();
$smtp->quit;