1 2 3 4 5 6 7 8 9 10 11
my $msg = MIME::Lite->new( From => $mailfrom, To => $mailto, Subject => $subject, Type => "multipart/related" ); $msg->attach( Type => "text/html", Data => $mailtext, ); $msg->send("smtp", "mail.domain.de");
1 2 3 4
my $smtpserver = "smtp.domain.com"; my $user = 'user'; my $pass = 'password'; $msg->send("smtp", $smtpserver, SSL => 1, Port => 25, AuthUser => $user, AuthPass => $pass);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
my $smtpserver = "smtp.domain.com"; my $user = 'user'; my $pass = 'password'; my $mailer = new Net::SMTP::TLS( $smtpserver, Port => 25, User => $user, Password=> $pass, SSL => 0); $mailer->mail($mailfrom); $mailer->to($mailto); $mailer->data; $mailer->datasend($msg->as_string); $mailer->dataend; $mailer->quit;
1
2
Couldn't start TLS: SSL connect attempt failed with unknown errorerror:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
at line 'my $mailer = new Net::SMTP::TLS('
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
#!/usr/bin/perl use strict; use warnings; use utf8; use IO::Socket::SSL; $IO::Socket::SSL::DEBUG = 3; my $mailfrom = 'info@meinserver.tld'; my $mailto = 'test123@meinserver.tld'; my $subject = 'Test für SMTP SSL'; my $mailtext = 'TEST<br>123'; use MIME::Lite; my $msg = MIME::Lite->new( From => $mailfrom, To => $mailto, Subject => $subject, Type => "multipart/related", ); $msg->attach( Type => "text/html", Data => $mailtext, ); use Net::SMTP; my $smtpserver = "mail.meinserver.tld"; my $user = 'test123@meinserver.tld'; my $pass = 'V3r7SeCw21'; my $mailer = Net::SMTP->new( $smtpserver, Port => 25, User => $user, Password=> $pass, SSL => 0, Debug => 1, ); $mailer->starttls(); $mailer->mail($mailfrom); $mailer->to($mailto); $mailer->data; $mailer->datasend($msg->as_string); $mailer->dataend; $mailer->quit;
2021-12-18T10:53:15 GustlNet::SSLeay ist nicht installiert, aber hat auch nicht geklappt unter Windows.
1
2
3
notest install Net::SSLeay
notest install Crypt::SSLeay
notest install IO::Socket::SSL