![]() |
![]() |
8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sub Email_Send { #Email,Titel,Text, From
use Net::SMTP;
my $Smtp;
$Smtp = Net::SMTP->new("127.0.0.1") or die $@;
$Smtp->mail($_[3]);
$Smtp->to($_[0]);
$Smtp->data();
$Smtp->datasend("Subject: $_[1]\n");
$Smtp->datasend("To: $_[0]\n");
$Smtp->datasend("\n");
$Smtp->datasend($_[2]);
$Smtp->dataend();
$Smtp->quit;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use strict;
use Net::SMTP;
my @email_addrs = ('test1@company.dot', 'test2@company.dot', 'test3@company.dot');
my $from = 'from@company.dot';
my $subject = "das ist ein test!";
my $body = qq~Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.~;
foreach my $to (@email_addrs)
{
email_send($to, $from, $subject, $body);
}
sub email_send
{
my ($to, $from, $subject, $text) = @_;
my $smtp;
$smtp = Net::SMTP->new("127.0.0.1") or die $@;
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("To: $to\n");
$smtp->datasend("\n");
$smtp->datasend($text);
$smtp->dataend();
$smtp->quit();
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use Net::SMTP;
my @email_addrs = ('test1@company.dot', 'test2@company.dot', 'test3@company.dot');
my $from = 'from@company.dot';
my $subject = "das ist ein test!";
my $body = qq~Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.~;
email_send(\@email_addrs, $from, $subject, $body);
sub email_send
{
my ($tos, $from, $subject, $text) = @_;
my $smtp;
$smtp = Net::SMTP->new("127.0.0.1") or die $@;
$smtp->mail($from);
$smtp->bcc(@{$tos});
$smtp->data();
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("To: Nobody");
$smtp->datasend("\n");
$smtp->datasend($text);
$smtp->dataend();
$smtp->quit();
}
![]() |
![]() |
8 Einträge, 1 Seite |