Tsohost Knowledge Base

How to send mail from scripts

Modified Wednesday 5th November, 2014 at 01:50

Was this helpful?

You'll often want to send emails through a script. The two main methods are using SMTP or Sendmail:

SMTP (Recommended): Usually the better option when sending emails as it goes through a dedicated local relay server, meaning there's less chance of it being rejected by the receiving server. To use SMTP your script will need to connect to the server 10.168.1.70 without SSL on port 25 with no authentication. This IP will only work in scripts run locally on the cloud.

Sendmail: Sendmail is a unix program used for sending mail. Mail sent with Sendmail is more heavily filtered than that sent by SMTP as it is very easy to send spoof emails using it. If you require it for you script however, the Sendmail binary is located at: /usr/bin/sendmail.


mailscriptsCloudSMTPSendmail

Still can't find what you're looking for?

Not a problem - our 24/7 customer support team are super friendly and here to help answer all your questions. There's no need to wait, click below to start a Live Chat.

Start Live Chat

Still can't find what you're looking for?

Not a problem - our 24/7 customer support team are super friendly and here to help answer all your questions. Don't delay, click below to find out how you can get in touch.

Get in Touch