Because the company has a data review requirement, the monthly data needs to be reviewed before it can be uploaded
The review method is to send the content to the designated person's mailbox, and then manually review the data before determining whether to upload the data
How to use C# to send emails with attachments????.NET contains many rich APIs for sending and receiving emails in the System.Net.Mail namespace, which makes it easy for us to develop functions related to sending and receiving emails
I have referenced some information from the Internet. I have encapsulated a method that allows you to set the sending server port through SmtpPort without filling in the default port 25.
Let's take a look at the renderings first, the effect of sending an attached email is as follows:
I sent the email to my QQ mailbox, and I can receive the email normally, and the attachment is displayed normally.
The call code is as follows:
The encapsulated email help class is as follows:
Tourists, if you want to see the hidden content of this post, please Reply
Source code download:
Tourists, if you want to see the hidden content of this post, please Reply
|