C # read outlook local signature


As we all know, it’s ok if you send e-mail automatically, but it’s more troublesome if you need to obtain it.

Now we recommend a method to get the signature.

You can edit the signature of the email in the email and save it locally.

The general path will be here

C:\\Users\\" + username + "\\AppData\\Roaming\\Microsoft\\Signatures\\

There are usually multiple files under this path. Just sign the file with suffix HTM

Then you read the HTM file and convert it into stream

Then you can filter some information you don’t need by regular expressions according to your needs

The processed data can be directly output as a string in the body, provided that

Set the bodyformat to HTML, so that the signature you set is what it looks like and the output is what it looks like