I'm having troubles with SMTP settings in my Laravel.
Here is the mail section of in my .env file:
MAIL_DRIVER=smtp
MAIL_HOST=xxxxx.com
MAIL_PORT=25
MAIL_USERNAME=yyyyy.com
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
I'm getting next error:
Swift_TransportException
Connection could not be established with host xxxxx.com :stream_socket_client(): unable to connect to tcp://xxxxx.com:25 (Permission denied)
I've also tried ports 587 and 465. The same result.
But simple Perl script with the same auth data is working correctly:
$To = '[email protected]';
$Server = 'xxxxx.com';
$From = '"Do Not Reply" <[email protected]>';
$ReplyTo = '"Do Not Reply" <[email protected]>';
$Invitation = "test.txt";
$smtp = Net::SMTP->new($Server, Hello => 'yyyyy.com', Timeout => 30, Debug => 1,);
$smtp->mail($From);
$smtp->to($To);
$smtp->data();
$smtp->datasend("To: $To
");
$smtp->datasend("From: $From
");
$smtp->datasend("Reply-To: $ReplyTo
");
open(INVITE, "<$Invitation") || die "Cannot open invitation: $!
";
while(<INVITE>) {
$smtp->datasend($_);
}
$smtp->dataend();
close INVITE;
$smtp->quit;
My only doubt is that Hello option in Perl script and MAIL_USERNAME in .env file is not the same option.
Maybe I should use other option for that in my .env file?
Thank you in advance!
question from:
https://stackoverflow.com/questions/65885588/laravel-smtp-settings-are-not-working-but-the-same-settings-are-working-in-perl 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…