Mail

发送邮件。

邮件发送成功返回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:465smtp://xxx.com:xxx。 在回测系统中不生效。

{@fun/Global/Mail_Go Mail_Go}