I need to search a string in a text file(to be more specific its a log file) and send a mail incase the string is found .
I need to search a string in a text file and send a mail incase the string is found
Collapse
X
-
Tags: None
-
Why you want to send an Email after searching the file, why not when the event is logged?
Regards
Dheeraj Joshi -
ya actually i want to send an mail when the event is logged, stating that event. Its like if the evnt is critical then I will have to send an email stating the entire event and what error occured.Comment
-
-
It looks like the Java Mail classes are the way forward and they are fairly easy to use too. If you get stuck with them post back - I'll keep an eye on this thread as I have some experience using these classes.
If you do need to check a file for a string then take a look here. I haven't written or reviewed this code but at first glance the basic principles seems to be spot on.
Hope this is helpful and remember to shout if you get stuck.
nathjComment
-
Comment