I would like to know if server has access to internet and if it can send email with the help of a python script. Server OS is Red Hat Enterprise 5. When I open firefox and enter an url, it can't connect. What shell commands should I use to check availability of sending email?
First make sure that you are connected to the internet by trying a ping command to one of the most popular site.
This will make sure you have the internet connectivity.
You can also try mailx on your system but this won't tell you anything about sending mail. You will need an SMTP host for that.
Try to telnet to a known mailhost on port 25:
if you get a connection you should be in business, otherwise the request will block and make you wait.