使用 JSL 发送电子邮件我正在尝试使用 JSL 发送电子邮件作为数据检索查询的一部分。如何将数据表或日志表嵌入到短信正文中?
谢谢
回复:使用 JSL 发送电子邮件嗨@dadawasozo ,
据我所知,我相信您只能将其添加为附件,而不能添加到电子邮件正文中。我认为它只能处理电子邮件中的文本。
DS
回复:使用 JSL 发送电子邮件嗨,DS,
是否可以在电子邮件正文(不是附件)中发送图片并同时附上表格? Eval() 和获取文本不适用于图片
回复:使用 JSL 发送电子邮件据我所知。回复:使用 JSL 发送电子邮件你好。感谢你的快速回复。
但是,我想再问一下,是否可以将照片附在邮件正文上?先感谢您。
回复:使用 JSL 发送电子邮件嗨@lalala ,
不确定是否有办法使用此线程之前列出的命令来执行此操作。文本仅以制表符分隔,您可以在电子邮件中对其进行编辑。当以文本形式发送表格时,我不知道有任何命令可以修改它
但是,有一个可能的解决方法可能适合您的需求。您必须以图片形式获取数据表报告,保存它,然后将其作为附件发送。它看起来像 JMP 报告窗口中的数据表格式。
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = Data Table( "Big Class" );
path="your path\"; //be sure to have the last backslash included in this.
tb=dt<<GET as="" report=""></GET>
You can of course save the picture in different formats than png.
The attachment will look like this:
<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 400px;"><span class="lia-inline-image-display-wrapper" image-alt="pic.png" style="width: 142px;"><img src="https://us.v-cdn.net/6038925/uploads/images/30392i0B4D2C1C507D8C67/pic.png" role="button" title="pic.png" alt="pic.png" /></span></SPAN>
Not ideal, but the data will be formatted and aligned as desired. It won't be editable or copy/pastable like the text email version. Perhaps you can put in a request to JMP to have them provide more options for the Get Text() command so it can provide more complex formatting options?
Hope this helps!,
DS
回复:使用 JSL 发送电子邮件你好。有没有办法固定每列的对齐方式?或者如果我可以更改此 HTML 电子邮件中使用的默认字体样式,因为使用的默认字体样式(arial)中的字母每个字母占用不同的空间(例如“I”具有不同的空间),因此该列似乎未对齐比“M”)。那么有没有办法改变字体样式或任何其他建议如何修复每列的对齐方式。谢谢。
回复:使用 JSL 发送电子邮件很高兴听到您解决了邮件客户端问题。奇怪的是它竟然如此依赖于此,但回车符也是如此。很高兴它现在为你工作。
DS回复:使用 JSL 发送电子邮件您好,确实是电子邮件客户端。我卸载了 Mailbird 并使用 Outlook 并且工作正常......
感谢您的帮助!
回复:使用 JSL 发送电子邮件您好,这是打印屏幕...我认为问题可能是因为我没有使用 Outlook 作为电子邮件客户端,而是使用 Mailbird。将尝试配置 Outlook 并更新

回复:使用 JSL 发送电子邮件嗨@Stefan ,
这实在是太奇怪了。我在 W10 64 位上运行 JMP Pro 15.2.1。这个功能当然不依赖于专业版,所以我无法想象是这样的。当我为 Big Class 运行该代码时,我收到以下电子邮件:

您是否准确地复制/粘贴了代码,仅更改了电子邮件地址?如果更改了电子邮件地址以外的代码,则可能会影响电子邮件中的格式。您有从 JMP 收到的代码和电子邮件的屏幕截图吗?
DS
回复:使用 JSL 发送电子邮件@SDF1感谢您的快速回复,尝试了您推荐的几个选项,但仍然没有乐趣。我在 Windows 上运行,JMP 15.2.1
这是电子邮件正文的摘录...
数据为姓名、年龄、性别、身高、体重...
回复:使用 JSL 发送电子邮件嗨@Stefan ,
使用所谓的“转义序列”有时会有点棘手。有时它们按照人们认为应该的方式工作,但有时需要以不同的方式调用它们。它有点像 :Column 与 Column(dt, #) 或 As Column()。它们都参考了专栏,但在某些情况下,其中一个比另一个更好。
不管怎样,您想要一个回车的具体示例,这里是一个与 JMP 中内置数据表一起使用的示例。
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = Data Table( "Big Class" );
tb=dt<<GET as="" report=""></GET>
You don't have to have the extra concatenate || in there between "The data is " and !\n. You can instead write it as "The data is !\n" || Eval() and it'll work just the same. But, however you implement it, the !\n must be in quotations: "\!n" for it to be read correctly.
One note that might be the reason you're having problems is the host operating system. If you're working in OS vs Windows, then the carriage return is different: CR vs CR LF, respectively. If you're on a Mac, the "\!n" won't work. Instead, you should use "\!N" with a capital N. When you use that, it insert a line break appropriate for the host operating system.
Hope this helps!,
DS
回复:使用 JSL 发送电子邮件你好,你是如何添加回车符的,我已经尝试了\!n 的所有选项,但没有成功。您可以添加一个例子吗?
干杯!
回复:使用 JSL 发送电子邮件不客气。我还发现,如果您在“开头句”之后的引号内包含 \!n,则可以在电子邮件中打印数据表之前有一个回车符。回复:使用 JSL 发送电子邮件嗨,DS,
非常感谢!!这就是我所需要的!我感谢您的帮助。
楼
回复:使用 JSL 发送电子邮件嗨@lou ,
这是一个巨大的挑战,我想我已经解决了。应该只有大约三行代码。
Names Default To Here( 1 );
dt = Data Table( "My Data Table" ); //this defines whichever data table you're dealing with
tb=dt<<GET as="" report=""></GET>
I tested it on a data table of mine and it worked great. It even puts the text in a data table style/format. It is just text, but this should solve the original problem.
UPDATE: I went back and tested if you could add more text to the body and you can if you wrap the <<GET text="" portion="" in="" an="" eval=""></GET>
Hope this helps!,
DS
回复:使用 JSL 发送电子邮件嗨,DS,
感谢您的回复。附加是一种替代方法。仍在寻找一种方法将其添加到主要消息中,无论是通过表格、日记还是图片。
楼
回复:使用 JSL 发送电子邮件嗨@lou ,
我在脚本索引中搜索了 Mail,发现了这个:
Names Default To Here( 1 );
Mail( "test@example.com", "revelation", "JMP is great.", "$SAMPLE_DATA/Big Class.jmp" );
我用警报脚本示例对其进行了测试,它向我发送了一条消息。我没有附加任何 JMP 文件,不确定它是否会嵌入电子邮件正文中,但它至少会提供添加附件的功能。应该可以解决你的问题。
希望这可以帮助!,
DS