If your site runs PHP, you should use the mail() function.
For all other languages, you should use /usr/bin/sendmail.
These are the only supported methods to send email from sites hosted on our service.
You may not connect to SMTP ports 25 or 465 on other networks' servers; these are SMTP MTA (mail transfer agent) ports used by full-time email servers to exchange existing messages with each other. Your web site is not an email server, so it is not appropriate for it to use these ports. Therefore, to prevent spammers from abusing our service, we actively block such connections.
Some email services offer authenticated SMTP MSA (mail submission agent) services on port 587 that may be appropriate for accepting new email messages from your site. However, doing so is unsupported by us and we do not guarantee it will be a suitable option for your circumstances; contact your email service if you need any assistance with this.