发送邮件。
邮件发送成功返回true
,发送失败返回false
。
bool
Mail(smtpServer, smtpUsername, smtpPassword, mailTo, title, body)
指定邮件发送方的SMTP
服务地址。
smtpServer
true
string
指定邮件发送方的邮箱地址。
smtpUsername
true
string
邮件发送方邮箱的SMTP
密码。
smtpPassword
true
string
指定邮件接收方的邮箱地址。
mailTo
true
string
邮件标题。
title
true
string
邮件正文。
body
true
string
function main(){
Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body")
}
def main():
Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body")
void main() {
Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body");
}
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
。
在回测系统中不生效。
{@fun/Global/Mail_Go Mail_Go}