how do i get error message

hi pals,
I had two error message as “I/O error” & “Corrupted file system detected”.

How do i get the error message and send mail to me?

pls help me, thanks very much.

More context would help give solution. There is no system per se that does it, but it’s possible to do it with proper redirection. Ex

chkdsk | sendmail

I found my system become very slow.
so I check my system.

I use “ls -l” on system, and i get the message – “Corrupted file system detected”.

So i need some method, send mail to me when happened the error .
catch the error-message in a script?

Could you guide me?
Thanks and Best Regards.