What is your SAS OS platform? SAS version? Is SAS running locally on your machine or on a remote server system? Possibly there are individual ports that are unavailable to you to use, likely SMTP EMAIL (outgoing) port maybe? The code you have shared appears correct syntactically. You will want to use PROC OPTIONS to check your EMAILSYS and other EMAIL-related parameters.
You may want to start out by reviewing the OPTIONS FILEMSGS; parameter - the Google advanced search argument below locates some SAS support website matches:
options filemsgs email error site:sas.com
Otherwise you may need to contact SAS support, if it appears unusual that you should (or should not) be able to generate outgoing EMAILs, based on the experience within your own office and network. It also may be worth contacting your network and mail admin team to inquire whether they think that it's feasible for you to being sending EMAILs out from a SAS environment.