If you can not send any email from your vps server, you need to install a MTA ( Mail transport agent )


Step 1 : Remove old sendmail packages

apt-get remove sendmail-bin exim4-base
apt-get autoremove

Step 2 : Install postfix

apt-get update
apt-get install postfix

Test it

You can see if it is working or not with this php script : <?php
$to = "myemail@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "admin@mydomain.com";
$headers = "From: $from";
echo "Mail Sent.";