for the first time ever i'm using a VPS for my hosting i have Apache2, LAMP on Ubuntu 12.04 i have installed a website and it's not sending mail via my contacts page or the registration verification emails etc...? Do i need to set up some kind of outgoing mail server ? like this tutorial https://www.digitalocean.com/community/articles/how-to-install-the-send-only-mail-server-exim-on-ubuntu-12-04 and if so will it work automaticly or will the sending script need to be reconfigured ?
Any help, links or info would be great.. i feel like this could be in the linux section on stackoverflow but i don't think ill get a answer there and it may require editing PHP so I've stuck it here. thanks for your time!
Email Contact form...
<?php
if($_POST['submit']){
$emailsend=get_value("siteemail");
$name=$_POST['name'];
$email=$_POST['email'];
$website=$_POST['website'];
$msg=$_POST['msg'];
if(strlen($name) > 3 && strlen($msg) > 10 && is_valid_email($email)){
$subiect="Contact support - Paid4Upload";
$mesaj="Nume: $name \n Email: $email \n Website: $website \n Message: $msg ";
$headers = 'MIME-Version: 1.0'."\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1"."\r\n";
$headers .= "From: $email"."\r\n";
mail($emailsend, $subiect, $mesaj, $headers);
echo "<div class=\"alert alert-success\">Email sent!</div>";
}else{
echo "<div class=\"alert alert-error\">Please complet all data</div>";
}
}
?>
<form action="" method="POST" class="form-horizontal">
<div class="form-group">
<label class="col-md-4 control-label">Full Name</label>
<div class="col-md-8">
<input type="text" placeholder="" name="name" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Email</label>
<div class="col-md-8">
<input type="text" placeholder="" name="email" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Website</label>
<div class="col-md-8">
<input type="text" placeholder="http://" name="website" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Message</label>
<div class="col-md-8">
<textarea cols="30" rows="5" placeholder="" name="msg" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-8">
<input type="submit" value="Send Message" name="submit" class="btn btn-danger btn-lg btn-block">
</div>
</div>
</form>