SMTP errors when trying to send e-mail from a script

SMTP errors when trying to send e-mail from a script

I want to configure automated scripts on my Linux machine to e-mail me status updates when they finish and am using mailx (although I can use pretty much any mail program that Zoho would prefer that I use). I use two factor authentication for my account, and have set up an application specific password for this use.

Here is my .mailrc file

set smtp-use-starttls
set nss-config-dir=~/.mozilla/firefox/8qm1qn5m.default-1234567890123/
set ssl-verify=ignore
set smtp=smtp://smtp.zoho.com:465
set smtp-auth=login
set smtp-auth-user=myuserid@mydomain.com
set smtp-auth-password=PaSsWoRd
set from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)"


[In the above, the italicized parts in nss-config-dir, smtp-auth-user and smtp-auth-password fields are some random values for the purposes of this post - my actual file contains the correct values.]

When I test it, here is the output I get (again, the parts in italics are not the actual values I used):

$ echo "Testing, testing, testing" | mail -v -s "Testing 3" myuserid@mydomain.com
Resolving host "smtp.zoho.com:465" ... done
Connecting to "204.141.32.118:465" ...connected.
SMTP: Resource temporarily unavailable
Unexpected EOF on SMTP connection
"/home/myusername/dead.letter" 8/207
... message not sent
$


This happens repeatedly. Does Zoho have instructions on how to set up a shell script to send e-mail? Alternatively, please tell me what next to debug the problem. If I am able to send e-mail successfully and reliably, I'd be happy to provide a short write-up for you to use. Thank you.