![]() |
|< 1 2 3 >| | ![]() |
26 Einträge, 3 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# POD-Dokumentation - siehe Dateiende!
package User::InetMw::SendMail;
use strict;
use vars qw(@ISA @EXPORT $VERSION);
use Exporter;
$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = qw(&SendMail);
sub _separator
{ return join ';', split /[ ,;]+/, shift;
}
use Win32::OLE;
sub SendMail
{ my(%mail_props) = @_;
return 'No Addressee to send mail to.' unless $mail_props{to};
my ($mail, $item);
$mail = new Win32::OLE('Outlook.Application')
and $item = $mail->CreateItem(0); # 0 = mail item.
return 'Outlook is not running, cannot send mail.' unless $item;
#$item->{From} = $mail_props{from} if $mail_props{from};
$item->{To} = _separator $mail_props{to};
$item->{Cc} = _separator $mail_props{cc} if $mail_props{cc};
$item->{Bcc} = _separator $mail_props{bcc} if $mail_props{bcc};
$item->{Importance} =
($mail_props{importance}) ? $mail_props{importance} : 1; # 2=high, 1=normal, 0=low
$item->{Subject} = $mail_props{subject} || '[No Subject]';
$mail_props{body} =~ s/([^\n])$/$1\n/;
$item->{Body} = $mail_props{body};
if ($mail_props{attachments})
{ my $attach = $item->{Attachments};
foreach my $attach_file (@{$mail_props{attachments}})
{ return 'No file indicated.' unless $attach_file;
return "$attach_file isn't any file." unless -f $attach_file;
$attach->add($attach_file);
}
}
$item->Send() or return 'Send aborted.';
return 0;
}
1;
=head1 NAME
User::InetMw:SendMail - Mails über Outlook senden
=head1 SYNOPSIS
use User::InetMw::SendMail;
my $error = SendMail
( to => 'name@domain.de;name@domain.com',
cc => 'ccname@domain.de', # optional
bcc => 'bccname@domain.de', # optional
importance => 1, # optional (2=high, 1=normal, 0=low)
subject => 'subject',
body => 'Mailtext',
attachments => ['//host/dir/file.xxx'],
);
=head1 DESCRIPTION
Mails werden mit der Adresse des aktuellen Benutzers gesendet.
Zwischen mehreren Mailadressen steht ';', ',', oder ' '.
=head1 AUTHOR
Steffen Winkler, 08.01.2003
=cut
1 2 3 4 5
$_=''; s%%`^.*`s;.*;uhtnmo;;a>lha~a>inu~a>fmk~a>rou~a>duM~a>btl~s;&&&&&&;!d1!l2!b3!i4!f5!r6q(?);e;Z` `}a>&&&`sub# "1#{#"_=shift#;s^"2^"3#^;``;~`return #"_#}``^!&&`"1(#""2)#\.`Z%; s~Z~print~g;s/#/\\/g;s/`(.)(.+?)`(.+?)`/s${1}${2}${1}${3}${1}g\;/g;s;&;(.);g;y^"^$^; print;
my @files = glob("*.*");
![]() |
|< 1 2 3 >| | ![]() |
26 Einträge, 3 Seiten |