SMTP 設定是否可以設定 SMTP 伺服器以使用 JSL 透過 SMTP 中繼傳送電子郵件?查看 SAS 上的一些選項,但不確定如何使用 JSL 進行設定。謝謝
回覆:SMTP 設定我只是嘗試將其添加到上面示例中的字串末尾,它起作用了:
-Attachments 'C:/file.txt'
完整的例子是:
Names Default To Here( 1 );
commands = {
"Send-MailMessage -From 'email@address' -To 'email@address' -Subject 'Test mail' -Body 'Message goes here' -SmtpServer smtp.server.com -Attachments 'C:/file.txt'\!n",
"exit\!n"
};
icommand = 0;
RP = Run Program(
Executable( "PowerShell.exe" ),
ReadFunction( Function( {this}, Write( this << Read ) ) ),
WriteFunction(
Function( {this},
icommand++;
If( icommand <= N Items( commands ),
this << Write( commands[icommand] );
,
this << WriteEOF;
);
)
)
);回覆:SMTP 設定我的文章帶有“-附件”功能以及相應的模型:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.1
在一些好的物品中,我找不到郵件。 J我們可以使用 une mauvaise 操作或使用 une mauvaise 語法。
您是否曾使用過 SVP 的腳本應用程式範例?
回覆:SMTP 設定您很可能可以使用所有不同的方法。 對於 PowerShell(我大部分時間都使用它),請參閱 Microsoft 文件。
回覆:SMTP 設定你好,
評論 je peux faire pour rajouter une pièce-jointe dans le mail svp ?
回覆:SMTP 設定如果您使用的是 Windows,這裡有一個使用 powershell 的選項:
Names Default To Here( 1 );
commands = {
"Send-MailMessage -From 'email@address' -To 'email@address' -Subject 'Test mail' -Body 'Message goes here' -SmtpServer smtp.server.com\!n",
"exit\!n"
};
icommand = 0;
RP = Run Program(
Executable( "PowerShell.exe" ),
ReadFunction( Function( {this}, Write( this << Read ) ) ),
WriteFunction(
Function( {this},
icommand++;
If( icommand <= N Items( commands ),
this << Write( commands[icommand] );
,
this << WriteEOF;
);
)
)
);有關 powershell 實用程式的資訊:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.1
請注意,這需要 powershell 版本 2:
https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/starting-the-windows-powershell-2.0-engine?view=powershell-7.1
回覆:SMTP 設定明白了。 也許有一些幫助這個較早的線程。
回覆:SMTP 設定感謝您的答覆。當我使用 Mail() 函數時,電子郵件是透過 Outlook 用戶端發送的,這會阻止我自動發送電子郵件。我正在嘗試使用 SMTP 路由來避免使用 Outlook 用戶端。有沒有辦法設定 mail() 函數以使用 SMTP 路由而不是 Outlook 用戶端?
回覆:SMTP 設定看一下“Mail()”命令。