I have already answered your part about the "automaticly sending an email" to a person. Well, here is that code, if it helps you.
For you, you would have to change a view variables, but that should be what your looking for. BTW, if you didn't already know, you must have a SMTP mail server that functions with your web server, if not, the mail() function will not work.
As you your .txt file thingy, I'll research that a lil.