専門家の皆様、ありがとうございます!
現在の JMP テーブルを直接読み取ります。
1行目には送信者のメール情報が含まれています
2行目には受信者のメール情報が含まれています
メールを受信後、現在の表の「コンテンツ」列の2行目に受信した内容を直接書き込みます。
dt = New Table(
"EmailConfig",
Add Rows(2),
New Column("Email", Character, Set Values({
"A@gmail.com",
"B@gmail.com"
})),
New Column("Password", Character, Set Values({
"AA",
"BB"
})),
New Column("Content", Character, Set Values({
"Test",
""
}))
);
Python の場合、これは質問する適切な場所ではありません。
JSLではどのようなサービスがありますか?JMPがアクセスできるメールを送受信するためのAPIはありますか?
専門家の皆様、ありがとうございます!
AIの
それは仕事ではありません。
dt = Current Data Table();
sender = Char(dt:Email[1]);
pwd_sender = Char(dt:Password[1]);
content = Char(dt:Content[1]);
receiver = Char(dt:Email[2]);
pwd_receiver = Char(dt:Password[2]);
proxy = "--proxy \!"http://127.0.0.1:7897\!"";
message_file = "C:\temp\jmp_message.txt";
Save Text File(message_file, "Subject: Test Email\n\n" || content);
send_options = {"smtp://smtp.gmail.com:587", "--mail-from", sender, "--mail-rcpt", receiver, "--user", sender || ":" || pwd_sender, "-T", message_file, "--ssl-reqd", proxy};
rp_send = Run Program(
Executable("curl.exe"),
Options(send_options),
ReadFunction(Function({this}, send_out = this << Read; Show(send_out); ))
);
Wait(10);
search_options = {"--url", "imaps://imap.gmail.com/INBOX", "--user", receiver || ":" || pwd_receiver, "-X", "\!"SEARCH ALL\!"", proxy};
rp_search = Run Program(
Executable("curl.exe"),
Options(search_options),
ReadFunction(Function({this}, search_out = this << Read; ))
);
match_pos = Contains(search_out, "* SEARCH");
if(match_pos > 0,
ids_start = match_pos + Length("* SEARCH ");
ids_end = Contains(search_out, "\r\n", ids_start);
ids = Substr(search_out, ids_start, ids_end - ids_start);
,
ids = "";
);
id_list = Words(ids, " ");
if(N Items(id_list) > 0,
last_id = id_list[N Items(id_list)];
,
last_id = "";
dt:Content[2] = "Receive Failed";
throw();
);
fetch_options = {"--url", "imaps://imap.gmail.com/INBOX", "--user", receiver || ":" || pwd_receiver, "-X", "\!"FETCH " || last_id || " BODY.PEEK[TEXT]\!"", proxy};
rp_fetch = Run Program(
Executable("curl.exe"),
Options(fetch_options),
ReadFunction(Function({this}, fetch_out = this << Read; ))
);
body_start = Contains(fetch_out, "{");
body_end = Contains(fetch_out, ")", body_start);
body_length = Num(Substr(fetch_out, body_start + 1, body_end - body_start - 1));
content_start = body_end + 2;
received_content = Substr(fetch_out, content_start, body_length);
cleaned = Trim(Regex(received_content, "[\\r\\n]+", " ", "GLOBALREPLACE"));
dt:Content[2] = cleaned;
直接お手伝いすることはできませんが、VScript を使用して JMP でメールを送信したり、Mail() コマンドを使用したり、PowerShell で Send-MailMessage などのオプションを使用したりすることができます。