Send an email.
A successful email delivery returns a true value, e.g., true
, and a failed delivery returns a false value, e.g., false
.
bool
Mail(smtpServer, smtpUsername, smtpPassword, mailTo, title, body)
Used to specify the SMTP
service address of the email sender.
smtpServer
true
string
Used to specify the email address of the email sender.
smtpUsername
true
string
The SMTP
password for the email sender’s mailbox.
smtpPassword
true
string
Used to specify the email address of the email recipient.
mailTo
true
string
Email title.
title
true
string
Email body.
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");
}
The smtpPassword
parameter sets the password for the SMTP
service, not the mailbox password.
When setting the smtpServer
parameter, if you need to change the port, you can add the port number directly in the parameter smtpServer
. For example: QQ mail smtp.qq.com:587
, which is available for testing.
If an error is reported: unencryped connection
, you need to modify the smtpServer
of the Mail
function. The parameter format is: ssl://xxx.com:xxx
, for example, the ssl
method of SMTP
for QQ mail: ssl://smtp.qq.com:465
or smtp://xxx.com:xxx
.
It does not work in the backtesting system.
{@fun/Global/Mail_Go Mail_Go}
IsVirtual Mail_Go