1, . set up Outlook email account (not the focus of this article)
2, . set up Outlook Trust Center as follows
If the following operation settings are not made, the prompt is as follows when Excel VBA calls Outlook to automatically send mail
2.1 Outlook - > tools - > Trust Center
2.2 programming access - > select "never send me suspicious activity warning (not recommended)", note: it is recommended to use Excel VBA to automatically send mail to enable this function
3, Enable Excel Macro
3.1 enable macro operations as follows:
Open Excel and click Office - > Excel, as shown below
Select "Trust Center" - > trust center setting on the left side of the "Excel option" form, as shown below:
In the "Trust Center" form - > macro settings, select the following two options
Then close Excel and open again to enable macro and VBA programming development.
4, Excel VBA development
4.1 create module class: clsModel, write the following code:
4.2 create an automatic email sending interface, so that users can see which line of Excel table to operate.
The main codes are as follows:
The contents of the Excel table are as follows