cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hcarr01
Level VI

RunProgram context closed - SMTP

Bonjour à tous,

 

À partir d’un serveur SMTP, j’essaye d’envoyer des pièces jointes à différentes personnes.
Le script fonctionne correctement.

Le seul problème est que lorsque je rajoute « !// » au début de mon script pour qu’il s’exécute directement, j’obtiens l’erreur suivante :

 

hcarr01_0-1704272297533.png

 

Voici le script que j’utilise :

 

//!

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;
			);
		)
	)
);

Merci de votre aide !

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: SMTP

see https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673679#M86115 .

When it works, you have a script window open the entire time. When it fails, no window is open, and JMP is using a temporary eval context which goes away at the end of the script.

You could probably also work around the issue with a loop at the end of the script that waits for the runprogram to finish before allowing the script to finish. That won't work if you expect to run other JSL or platforms while runprogram works in the background, but approximately like this:

RP=runprogram(...);
while(1,
 // check the message names, there might be another one you need too
 if(RP<<canread == 0 & RP<<canwrite == 0 , break() );
 wait(0.1);
)

That way the eval context will persist until runprogram is done.

Craige

View solution in original post

1 REPLY 1
Craige_Hales
Super User

Re: SMTP

see https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673679#M86115 .

When it works, you have a script window open the entire time. When it fails, no window is open, and JMP is using a temporary eval context which goes away at the end of the script.

You could probably also work around the issue with a loop at the end of the script that waits for the runprogram to finish before allowing the script to finish. That won't work if you expect to run other JSL or platforms while runprogram works in the background, but approximately like this:

RP=runprogram(...);
while(1,
 // check the message names, there might be another one you need too
 if(RP<<canread == 0 & RP<<canwrite == 0 , break() );
 wait(0.1);
)

That way the eval context will persist until runprogram is done.

Craige

Recommended Articles