Schrift
[thread]4351[/thread]

mail mit dem attachment senden (Seite 2)

Leser: 1


<< |< 1 2 >| >> 12 Einträge, 2 Seiten
cc
 2004-03-03 11:41
#38172 #38172
User since
2004-01-09
55 Artikel
BenutzerIn
[default_avatar]
sorry mein script sieht so aus:
Code: (dl )
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
#!/usr/bin/perl -w
use MIME::Lite;
use Getopt::Std;
use Net::SMTP;

my $SMTP_SERVER = '/usr/sbin/sendmail -t';
my $DEFAULT_SENDER = 'sender@domain.net';
my $DEFAULT_RECIPIENT = 'recipient@domain.net';

MIME::Lite->send('sendmail', $SMTP_SERVER, Timeout=>60);

my (%o, $msg);

# process options
getopts('hf:t:s:', \%o);

$o{f} ||= $DEFAULT_SENDER;
$o{t} ||= $DEFAULT_RECIPIENT;
$o{s} ||= 'attachment';

if ($o{h} or !@ARGV) {
die "usage:\n\t$0 -h -f -t -s /var/log/log.txt\n";
}

# construct and send email
$msg = new MIME::Lite(
From => $o{f},
To => $o{t},
Subject => $o{s},
Data => "Hi",
Type => "multipart/mixed",
);

while (@ARGV) {
$msg->attach('Type' => 'application/octet-stream',
'Encoding' => 'base64',
'Path' => shift @ARGV);
}

$msg->send( );


wie gesagt, bekomme weder mail noch attachment
sendmail funktioniert sonst einwandfrer und
der pfad zu sendmail stimmt auch

mit dem code sample, welchen ptk vorgeschlagen hat
komme aber nicht klar\n\n

<!--EDIT|cc|1078578597-->
cc
 2004-02-28 02:16
#38173 #38173
User since
2004-01-09
55 Artikel
BenutzerIn
[default_avatar]
hallo

bringe folgendes script gemäss:

http://www.perl.com/pub/a/2003/09/0...ook.html?page=2

nicht zum laufen.
bekomme weder mail noch attachment, aber keine fehlermeldungen
Code: (dl )
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
#!/usr/bin/perl -w
use MIME::Lite;
use Getopt::Std;

my $SMTP_SERVER = '/usr/sbin/sendmail -t';
my $DEFAULT_SENDER = 'sender@domain.net';
my $DEFAULT_RECIPIENT = 'recipient@domain.net';

MIME::Lite->send('smtp', $SMTP_SERVER, Timeout=>60);

my (%o, $msg);

# process options

getopts('hf:t:s:', \%o);

$o{f} ||= $DEFAULT_SENDER;
$o{t} ||= $DEFAULT_RECIPIENT;
$o{s} ||= 'attachment';

if ($o{h} or !@ARGV) {
die "usage:\n\t$0 -h -f -t -s /var/log/log.txt\n";
}

# construct and send email

$msg = new MIME::Lite(
From => $o{f},
To => $o{t},
Subject => $o{s},
Data => "Hi",
Type => "multipart/mixed",
);

while (@ARGV) {
$msg->attach('Type' => 'application/octet-stream',
'Encoding' => 'base64',
'Path' => shift @ARGV);
}

$msg->send( );


gruss
cc\n\n

<!--EDIT|cc|1078578656-->
<< |< 1 2 >| >> 12 Einträge, 2 Seiten



View all threads created 2004-02-28 03:06.