Details on the use of the Mail () API

Author: The Little Dream, Created: 2016-05-14 11:25:51, Updated: 2020-10-29 16:18:40

Recently, a group of friends in the official QQ group asked how to use the API of the email reminder function, this policy was found in the square.

This error-reporting policy cannot be run because the parameters are not set correctly, and it is not a policy problem.

Strategy of the Squareimg

The following parameters:

img

  • Detection interval: This parameter is not necessary to modify, it is the default.
  • A reminder: This one has a classification, you can see for yourself.
  • SMTP server: This setting is one of the keys, if I don't know the address of this server, I can search for it, like my QQ mailbox, I can search for it on Baidu.
  • Email address: This is an email address, which is the email address from which your email is sent.
  • Inbox password: This is not the password for the inbox you set up on it, but the password you generate when you open the SMTP service.
  • Inbox: This can be set to receive your own mail, i.e. the above mailbox sends emails to itself, the other set to send emails to other mailboxes.
Below, for ease of testing, I've separately tested the API function of SendEmail, using the following code:
function main(){
    var ret = Mail("smtp.qq.com", "5618458475@qq.com", "hwefdgxzaasdzyiabc", "5618458475@qq.com" , "提醒", "余额变动 提醒!");
    Log(ret);
}
  • See the API description of the platform:img

Mail(“smtp.qq.com”, “5618458475@qq.com”, “hwefdgxzaasdzyiabc”, “5618458475@qq.comThis is the first time that the Chinese government has issued a warning to the public about the change in the balance.

  • smtp.qq.comQ: The SMTP server address of the QQ mailbox.
  • “5618458475@qq.comThe QQ e-mail address of the sender.
  • The key to the SMTP service.img
  • “5618458475@qq.comA: The recipient's email address is the same as the sender's.
  • This parameter is the title of the message.
  • Changes in email balance Alert: This parameter is the actual text of the email.
It failed at first due to my setup error, but after adjusting it, it returned true.

img

  • I also received an e-mail in my inbox.
    img

Below is an article I found online about opening SMTP.

Steps to start SMTP service in QQ mailbox The first thing to do is to make sure that your QQ account has been open for more than a month. For new accounts, Tencent does not open these features.

The method/steps

  1. The first thing you do is mark the envelope symbol next to the QQ image and send it to your inbox. Of course, you can also use mail.qq.com to enter your mailbox.

  2. Click the settings button at the top after entering the mailbox

  3. Click the secondary directory tab, the account tab, drag to the bottom of the middle, and tick the two boxes.

  4. QQ mailbox POP3 and SMTP server address settings are as follows: mailbox POP3 server ((port 110) SMTP server ((port 25)qq.compop.qq.comsmtp.qq.com SMTP server requires authentication.

If the SSL encryption for POP3 and SMTP is set, the port is: POP3 server (port 995) SMTP server ((port 465 or 587) ).

  1. If you are a WordPress user, you can use the SMTP mailbox plugin.http://jingyan.baidu.com/article/ca2d939dc65a86eb6c31cea4.html

In addition, the Mail ((() function does not support retesting, it must be run with a robot. Various questions are welcome in the official QQ group 309368835, various gods take you in the quantized world fly~


More

lazypThe top