Mail
发送邮件。
Mail(smtpServer, smtpUsername, smtpPassword, mailTo, title, body)示例
通过SMTP服务器发送邮件。
javascript
function main(){
Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body")
}
python
def main():
Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body")
rust
fn main() {
Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body");
}返回值
| 类型 | 描述 |
bool | 邮件发送成功时返回真值,例如: |
参数
| 名称 | 类型 | 必填 | 描述 |
smtpServer | string | 是 | 用于指定邮件发送方的 |
smtpUsername | string | 是 | 用于指定邮件发送方的邮箱地址。 |
smtpPassword | string | 是 | 用于指定邮件发送方邮箱的 |
mailTo | string | 是 | 用于指定邮件接收方的邮箱地址。 |
title | string | 是 | 邮件标题。 |
body | string | 是 | 邮件正文。 |
参考
备注
smtpPassword参数设置的是SMTP服务的密码,而非邮箱登录密码。
设置smtpServer参数时,如果需要更改端口,可以直接在smtpServer参数中加入端口号。例如:QQ邮箱smtp.qq.com:587,该端口经测试可用。
如果出现报错:unencryped connection,需要修改Mail函数的smtpServer参数。参数格式为:ssl://xxx.com:xxx,例如QQ邮箱SMTP的ssl连接方式:ssl://smtp.qq.com:465,或者smtp://xxx.com:xxx。
该函数在回测系统中不起作用。