현재 JSL의 메일 기능을 사용하면 유효한 이메일 주소 목록으로 이메일을 보낼 수 있지만 목록을 증가시키고 각 수신자에게 개별 이메일을 보내면 됩니다.이메일 클라이언트가 JMP에서 이메일을 보낼 수 있도록 사용자 개입이 필요한 시스템(예: 기업 환경의 Windows용 Outlook)에서 이는 사용자가 앉아서 각 수신자에 대한 경고 메시지를 기다려야 함을 의미합니다. -지연!이것은 매우 비효율적이며, 관심 있는 이해 관계자에게 보고서를 보내는 데 메일 기능을 사용하여 자동화할 때 보고서를 수동으로 복사하여 이메일에 붙여넣는 것만큼 더 많은 시간이 필요하지 않더라도 더 많은 시간이 필요함을 의미합니다.
JMP 버전 16.2.0
예제 코드(임시 폴더에 png로 저장된 보고서, 더미 이메일 주소 사용):
sites = {"Site-1", "Site-2"};
report_path = Convert File Path( "$TEMP" );
default_dn = "example.com";
maillist = Associative Array(
sites,
{{// Site-1
"support@example.com", "stakeholder1@example.com", "stakeholder2@example.com", "stakeholder3@example.com"},
{// Site-2
"support@example.com", "stakeholder3@example.com", "vpsales@example.com"}}
);
For( i = 1, i <= N Items( sites ), i++,
site = sites[i];
rep_title = Eval Insert( "^site^_Report" );
temp_file_path = Convert File Path( report_path || "/" || rep_title || ".png" );
winmail = New Window( Eval Insert( "Send ^site^ Email" ),
V List Box(
Lineup Box( N Col( 2 ),
Text Box( "To:" ),
H List Box(
lb_to = List Box( maillist[site], <<NLINES> 0,
newl = lb_to << Get Items;
For( i = N Items( newl ), i > 0, i--,
If( Contains( seli, i ),
Remove From( newl, i )
)
);
lb_to << Set Items( newl );
);
)
)
),
Text Box( "Subject:" ),
teb_subj = Text Edit Box( rep_title ),
Text Box( "Body:" ),
teb_body = Text Edit Box(
Eval Insert( "Hello All,\!N\!tPlease find ^rep_title^ attached.\!N\!N" ),
<<SETNLINES></SETNLINES></NLINES>