Leser: 1
|< 1 2 >| | 15 Einträge, 2 Seiten |
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
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl
use warnings;
use strict;
use Win32::OLE;
my $To = ""; $To = shift;
my $Cc = ""; $Cc = shift;
my $Subject = ""; $Subject = shift;
my $Body = ""; $Body = shift;
($To) or die "USAGE: $0\n <\"To\">\n [<\"Cc\">]\n [<\"Subject\">]\n [<\"Body\">]\n [<\"Attachment 1\">]\n [<\"Attachment 2\">]\n [<\"Attachment ...\">]\n";
my $Email = Win32::OLE->new('Outlook.Application') or die $!;
my $Items = $Email->CreateItem(0) or die $!;
$Items->{'To'} = $To;
$Items->{'CC'} = $Cc;
$Items->{'Subject'} = $Subject;
$Items->{'Body'} = $Body;
foreach my $Attach (@ARGV) {
die $! if not -e $Attach;
my $Attachments = $Items->Attachments();
$Attachments->Add($Attach);
} # foreach
$Items->Send();
my $Error = Win32::OLE->LastError();
print "Email wurde erfolgreich gesendet.\n" if not $Error;
print "Email konnte nicht versendet werden.\n" if $Error;
1;
1
2
3
4
my $To = ""; $To = shift;
my $Cc = ""; $Cc = shift;
my $Subject = ""; $Subject = shift;
my $Body = ""; $Body = shift;
1
2
3
4
my $To = ""; $To = shift;
my $Cc = ""; $Cc = shift;
my $Subject = ""; $Subject = shift;
my $Body = ""; $Body = shift;
perl script.pl Empfaänger Kopie betreff Nachicht attachment1 attachment2 attachment3 ...
perl script.pl Empfaänger Kopie betreff Nachicht attachment1 attachment2 attachment3 ...
perl script.pl "Empfaänger" "Kopie" "betreff" "Nachicht" "attachment1" "attachment2" "attachment3" ...
|< 1 2 >| | 15 Einträge, 2 Seiten |