Between the time you check connectivity and the time you want to send an email, your Internet connection may go down, or the Internet may encounter problems (DNS outages, DOS attacks, etc), or the server may go into maintenance mode, or .... So, there is no real benefit to checking the connection ahead of time. Simply attempt the connection at the time you actually want to send the email, and handle any errors that may occur at that time. That is your simplest and best option.