网站似乎没有邮件?

时间:2014-01-30 04:52:25

标签: php email ubuntu

我第一次使用VPS进行托管我在Ubuntu 12.04上安装了Apache2,LAMP我安装了一个网站,它不是通过我的联系人页面或注册验证电子邮件等发送邮件......?我需要设置某种外发邮件服务器吗?喜欢这个教程https://www.digitalocean.com/community/articles/how-to-install-the-send-only-mail-server-exim-on-ubuntu-12-04,如果是这样,它会自动运行还是需要重新配置发送脚本?

任何帮助,链接或信息都会很棒..我觉得这可能是在stackoverflow的linux部分,但我不认为生病得到答案,它可能需要编辑PHP所以我把它卡在这里。谢谢你的时间!

电子邮件联系表格......

<?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>

0 个答案:

没有答案