发送邮件。
邮件发送成功返回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", "[email protected]", "password", "[email protected]", "title", "body")
}
def main():
Mail("smtp.163.com", "[email protected]", "password", "[email protected]", "title", "body")
void main() {
Mail("smtp.163.com", "[email protected]", "password", "[email protected]", "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}