SMTP 설정JSL을 사용하여 SMTP 릴레이를 통해 이메일을 보내도록 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 설정J'ai 에세이 avec la fonction « -Attachment » en suivant le modèle de ce lien:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.1
En indiquant le bon chemin d'accès, je ne reçois pas de mail. 제이 e dois faire une mauvaise 조작 또는 une mauvaise 구문을 활용합니다.
avez-vous un exemple de script faisant appel à une pièce-jointe 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 클라이언트를 통해 이메일이 전송됩니다.Outlook 클라이언트 사용을 피하기 위해 SMTP 라우팅을 사용하려고 합니다.Outlook 클라이언트 대신 SMTP 라우팅을 사용하도록 mail() 기능을 구성하는 방법이 있습니까?
답: SMTP 설정'Mail()'을 살펴보세요. 명령 .
답: SMTP 설정제 생각에는 이러한 유형의 문제는 JMP가 아닌 Windows 명령줄이나 Powershell에서 일반적으로 발생하는 문제이므로 일반적으로 Windows 명령줄이나 Powershell 내에서 디버그하기가 더 쉽습니다(때때로 JMP에서 인용 시 문제가 발생하기도 함).
답: SMTP 설정특정 문자가 없는 경로에서도 작동하도록 만들었습니다(예: "è", "é"...).
메시지와 경로에 특수 문자를 사용하는 특별한 기능이 있나요?

레지스트리에 이 오류 메시지가 나타납니다.
PowerShell에서 인코딩 유형을 수정하기 위해 줄을 추가했지만 문제가 해결되지 않습니다.


또한 이메일 본문의 줄을 건너뛰려고 하는데 "\n"과 같은 다른 방법을 사용해 보았습니다... 하지만 작동하지 않습니다.
답: SMTP 설정좋은 아침이에요,
귀하의 방법을 사용하여 이메일 본문(-Body)을 수정할 수 있습니까?
예를 들어, 줄 바꿈과 공백을 사용하여 이메일을 작성할 수 있습니까?
이메일의 예:
좋은 아침이에요,
귀하가 받게 될 정보는 다음과 같습니다.
- 정보1
- 정보2
감사해요
답: SMTP 설정작동하는지 시도해 보셨나요? 제가 기억하는 경우에는 그래야 하지만 Powershell 규칙에 따라 본문을 구축해야 할 수도 있습니다(예: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.4#here-strings ).
Send-MailMessage를 사용하여 JMP에서 이메일을 보내는 함수를 작성할 때 -BodyAsHtml을 사용하는 것이 -Body보다 더 쉽다는 것을 알았습니다.
답: SMTP 설정귀하의 답변에 감사드립니다!
예시를 보여주실 수 있나요?
나는 이미 이런 것을 시도했다
답: SMTP 설정Names Default To Here( 1 );
str = "\[$body = '
Attached to this email
You will find Instructions
'
Write-Output $body
]\";
RP = Run Program(
Executable("powershell.exe"),
Options({str}),
ReadFunction("text")
);답: SMTP 설정아래 스크립트에 추가해도 될까요?
'주문' 섹션에 있나요?
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;
);
)
)
);답: SMTP 설정Names Default To Here( 1 );
str = "\[$body = '
Attached to this email
You will find Instructions
'
Send-MailMessage -From 'email@address' -To 'email@address' -Subject 'Test mail' -Body $body -SmtpServer smtp.server.com
]\";
RP = Run Program(
Executable("powershell.exe"),
Options({str}),
ReadFunction("text")
);답: SMTP 설정좋습니다. 응답해 주셔서 감사합니다!
마찬가지로 이메일 본문에도 특수문자를 추가할 수 있나요?
답: SMTP 설정Send-Mailmessage에는 -Encoding 매개변수가 있습니다. Send-MailMessage(Microsoft.PowerShell.Utility) - PowerShell | 마이크로소프트 런 작동 할 수 있습니다. 아니면 여기에 문자열이 필요하거나 html로 변환하여 관리해야 할 수도 있습니다.
편집하다:
Names Default To Here( 1 );
str = "\[$body = @'
Use a quotation mark, like ' or ", to begin a string.
!\!"#$%&'()*+,-./:;<=>?@[\]^`{|}~‒–—―‘’‚‛“”„‟…
'@
Write-Output $body
]\";
RP = Run Program(
Executable("powershell.exe"),
Options({str}),
ReadFunction("text")
);
답: SMTP 설정당신의 답변에 감사드립니다.
특수 문자에 대해 이야기할 때 특히 "é" 또는 "à" 악센트에 대해 이야기했습니다.
답: SMTP 설정좋은 아침이에요,
(-Attachment 부분에서) 여러 개의 첨부 파일을 동시에 추가할 수 있나요?
답변해 주셔서 감사합니다.
답: SMTP 설정Send-MailMessage에 대한 Microsoft 문서를 올바르게 읽었다면 여러 경로를 제공할 수 있습니다. (저는 JMP를 사용하여 여러 첨부 파일을 보냈습니다.)