You can send email using UTL_SMTP or using a bash script. (or using any other tool that can speak SMTP..)
The query that you are looking for is a well known query and you can write it yourself.
check the Core DBA scripts page for some standby check query examples:
http://ermanarslan.blogspot.com.tr/p/core-dba-scripts.html