• @mytrashcan the reason for error is related port number/ipaddress of smtp server/firewall setting.

    The port number used by gmail is 587 rather than 25 and to find ipaddress ping "smtp.gmail.com" (you can even use smtp.gmail.com).