Send email.
Mail(smtpServer, smtpUsername, smtpPassword, mailTo, title, body)Examples
javascript
function main(){
Mail("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body")
}
python
def main():
Mail("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body")
c++
void main() {
Mail("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body");
}Returns
| Type | Description |
bool | Returns |
Arguments
| Name | Type | Required | Description |
smtpServer | string | Yes | Specify the |
smtpUsername | string | Yes | Specify the email address of the email sender. |
smtpPassword | string | Yes | The |
mailTo | string | Yes | Specify the email address of the email recipient. |
title | string | Yes | Email subject. |
body | string | Yes | Email body content. |
See Also
Remarks
The smtpPassword parameter is set to the SMTP service password, not the email login password.
When setting the smtpServer parameter, if you need to change the port, you can directly specify the port number in the smtpServer parameter. For example: QQ Mail smtp.qq.com:587 (this port has been tested and is available).
If an error message appears: unencryped connection, you need to modify the smtpServer parameter of the Mail function. The parameter format is: ssl://xxx.com:xxx, for example, QQ Mail's SMTP SSL method: ssl://smtp.qq.com:465, or use the format smtp://xxx.com:xxx.
This function does not work in the backtesting system.