In Linux, you can use mutt to send emails conveniently. In the previously used VPs space, only scripts can be written and mutt can be used to regularly back up the database and send it to the specified mailbox. You do not need to set the email address of the sender.
In Windows, how does one send attachments to the specified mailbox?
I started to wonder if mutt can be used for windows, but it is troublesome to install it. After searching the information, it is better to use vbs to send it. With the bat batch command, you can back up the database and send it to the specified mailbox.
VbsSource codeAs follows:
Namespace = "http://schemas.microsoft.com/cdo/configuration/" set email = Createobject ("CDO. message ") email. from = "account @ QQ.com" email. to = "account to be sent to @ QQ.com" email. subject = "test Sendmail. vbs "email. textbody = "OK! "Email. addattachment "D: \ dfj.zip" with email. configuration. fields. item (namespace & "sendusing") = 2. item (namespace & "smtpserver") = "smtp.qq.com ". item (namespace & "smtpserverport") = 25. item (namespace & "smtpauthenticate") = 1. item (namespace & "sendusername") = "account ". item (namespace & "sendpassword") = "password ". update end with email. send
You must enable the SMTP and POP3 services in your mailbox. Otherwise, the email cannot be sent successfully. If you do not enable it, the QQ system will automatically send an email to you (this is very user-friendly)
If you have any questions, please contact me. QQ 1508496092
Set
You can test the settings ~
Escape characters in batch processing:
Reference: On the server we maintain, one server needs to display the "Shanghai Stock Exchange/Shenzhen Stock Exchange" index. Code For what reason, the maintenance personnel should change the date in the HTML file to the date of the day before opening every morning. I want to use bat in this way (this server is a Windows system )? BAT can print the content with ECHO and append it to the file name?
Problem:
Of course, "<>" is indispensable for HTML code, such as <HTML>, we all know that the two symbols "<" and ">" represent "input redirection" and "output redirection" respectively, so it is not possible to directly echo <HTML>. Escape characters are required!
Key Point: escape characters // Output the <HTML> string in Windows: C: \>
Echo ^ <HTML ^>
<HTML> // Output the <HTML> string in Linux: # Echo \ <HTML \>
<HTML>
Summary: "^" Is used for escape characters in windows; "\" is used for escape characters in Linux "\"