여러분, 안녕하세요,
SMTP 서버에서 다른 사람에게 첨부 파일을 보내려고 합니다.
스크립트가 올바르게 작동합니다.
유일한 문제는 스크립트 시작 부분에 "!//"를 추가하여 직접 실행하면 다음 오류가 발생한다는 것입니다.

내가 사용하는 스크립트는 다음과 같습니다.
//!
Names Default To Here( 1 );
// modifier le type de codage dans le PowerShell (windows)
stringCommand = "$OutputEncoding = [System.Text.Encoding]::UTF8";
// paramètres du mail à envoyer
commands = {
"Send-MailMessage -From '... -To '...' -Subject 'test' -Body 'test' -SmtpServer... -Attachment "test...",
"exit\!n"
};
// script exécution PowerShell
icommand = 0;
RP = Run Program(
Executable( "PowerShell.exe", stringCommand, ShowWindow("Hide") ),
ReadFunction( Function( {this}, Write( this << Read ) ) ),
WriteFunction(
Function( {this},
icommand++;
If( icommand <= N Items( commands ),
this << Write( commands[icommand] );
,
this << WriteEOF;
);
)
)
);도움을 주셔서 감사합니다!