Leser: 1
![]() |
|< 1 2 >| | ![]() |
12 Einträge, 2 Seiten |
my $SMTP_SERVER = 'smtp.domain.net';
MIME::Lite->send('smtp', $SMTP_SERVER, Timeoute => 60);
MIME::Lite->send('smtp', $SMTP_SERVER, Timeout => 60);
MIME::Lite->send("sendmail", "/usr/lib/sendmail -t -oi -oem");
1
2
3
4
5
6
7
my @to = ('some@domain.ex', 'body@domain.ex');
sub Smtp # ...
{
#...
$smtp->to(@to);
#...
}
1
2
3
4
5
6
open(MAIL, "|/usr/sbin/sendmail -t") || die "Cant send mail. Reason: $!";
print MAIL "to:recipient\@domain.net\n";
print MAIL "from:sender\@domain.net\n";
print MAIL "subject:test !\n";
print MAIL "hi \n\n";
close(MAIL);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
sub Smtp { #Email,Titel,Text
use Net::SMTP;
my $Smtpserver = '127.0.0.1';
my $smtp = Net::SMTP->new($Smtpserver) 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;
}
$smtp->to("bla@foo.com, [EMAIL=foo@example.com]foo@example.com[/EMAIL]")
![]() |
|< 1 2 >| | ![]() |
12 Einträge, 2 Seiten |