Mail_Go
Asynchronous version of the Mail function. Supported in JavaScript and Rust; not available in Python.
Mail_Go(smtpServer, smtpUsername, smtpPassword, mailTo, title, body)Examples
Send two emails concurrently, then wait for each result.
javascript
function main() {
var r1 = Mail_Go("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body")
var r2 = Mail_Go("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body")
var ret1 = r1.wait()
var ret2 = r2.wait()
Log("ret1:", ret1)
Log("ret2:", ret2)
// Output: ret1 and ret2 are both true when sent successfully
}
rust
fn main() {
let r1 = Mail_Go("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body");
let r2 = Mail_Go("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body");
// wait(0) waits until the mail has been sent (JS: wait() with no argument) and returns
// Result<bool>
let ret1 = r1.wait(0);
let ret2 = r2.wait(0);
Log!("ret1:", ret1);
Log!("ret2:", ret2);
}Returns
| Type | Description |
object | The |
Arguments
| Name | Type | Required | Description |
smtpServer | string | Yes | Used to specify the |
smtpUsername | string | Yes | Used to specify the email address of the email sender. |
smtpPassword | string | Yes | The |
mailTo | string | Yes | Used to specify the email address of the email recipient. |
title | string | Yes | Email subject. |
body | string | Yes | Email body content. |
See Also
Remarks
Does not work in the backtesting system.