Thread [Net::SMTP::_SSL] Connection closed (16 answers)
Opened by bianca at 2015-08-31 09:40

Kean
 2015-10-08 15:14
#182528 #182528
User since
2004-08-18
463 Artikel
BenutzerIn

user image
Ich habe deinen Verbindungsaufbau mal eingebaut und getestet. Es kommt keine Fehlermeldung, wird aber auch keine Email versendet.
Mit DEBUG => 1 wird leider auch nichts ausgegeben außer dem "Done" am Ende.

Code (perl): (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
42
43
44
45
#!/usr/bin/perl

use warnings;
use strict;
require Net::SMTP; 
require IO::Socket::SSL;

IO::Socket::SSL->import(qw(SSL_VERIFY_CLIENT_ONCE));

my $user = 'me@mail.de';
my $pass = '123456';

my $server     = 'smtp.strato.de';
my $to         = 'test@mail.de';
my $from_name  = 'Testaccount';
my $from_email = 'imaptest@mail.de';
my $subject    = 'test';

# Verbindungsherstellung

my $smtps = Net::SMTP->new(
                                                        $server,
                                                        SSL_verify_mode => SSL_VERIFY_CLIENT_ONCE(),
                                                        )
or do {
                print "Keine Kommunikation mit dem SMTP-Server 'URL' möglich";
                return 0;
        };

defined ($smtps->auth($user, $pass))
    or die "Can't authenticate: $!\n";


$smtps->mail($from_email);
$smtps->to($to);
$smtps->data();
$smtps->datasend("To: $to\n");
$smtps->datasend(qq^From: "$from_name" <$from_email>\n^);
$smtps->datasend("Subject: $subject\n\n");
$smtps->datasend("This will be the body of the message.\n");
$smtps->datasend("\n--\nVery Official Looking .sig here\n");
$smtps->dataend();
$smtps->quit();

print "done\n";


Hast du vielleicht eine Idee an was das liegen könnte?

View full thread [Net::SMTP::_SSL] Connection closed