0
我有以下代碼:localhost連接使用Mail :: Sendmail的模塊無法在Windows 10
#!C:\Perl\bin\perl.exe -w
use strict;
use warnings;
use Mail::Sendmail;
sendmail(
From => '[email protected]',
To => '[email protected]',
Subject => 'test email',
Message => "body of the message",
);
我得到以下錯誤:
Connect to localhost failed (An attempt was made to access a socket in a way forbidden by its access permissions.) no (more) retries!
我不知道如何糾正它,有什麼想法?我使用的是Windows 10
指定SMTP服務器@戴夫我認爲他們的意思是他們在Windows 10上運行該程序,而不是在Windows 10上運行。 – simbabque
除了應用命令行開關之外,在Perl代碼中放置一行'#!'行是沒有意義的。 Windows命令處理器會忽略它,並使用文件擴展名來確定要使用哪個程序來執行代碼。既然你有'使用警告',那麼也沒有必要使用'-w',你可以完全刪除第一行。 – Borodin