我正在尝试将我的联系人配置到我的远程服务器。我托管的技术人员已经为我的邮件设置发了这个设置:
(POP3 / IMAP)&外发邮件(SMTP)服务器名称为:mail.yourdomain.com 端口是:POP3 - > 110,IMAP - > 143和SMTP - > 25或2525
不幸的是,我不知道在哪里插入我的php联系人文件。
这些是联系人文件:
contact.html
<form role="form" action="contact.php" method="post">
<div class="text-fields">
<div class="form-group">
<input type="text" class="form-control" name="bbname" id="bbname" placeholder="name:">
</div>
<div class="form-group">
<input type="email" class="form-control" name="bbemail" id="bbemail" placeholder="email:">
</div>
<div class="form-group">
<input type="text" class="form-control" name="bbphone" id="bbphone" placeholder="phone:">
</div>
</div>
<div class="submit-area">
<div class="form-group">
<textarea class="form-control" placeholder="message:" name="bbmessage" id="bbmessage"></textarea>
</div>
<button type="submit" class="btn btn-default" id="bbsubmit">Send it</button>
</div>
</form>
contact.php
<?php
$field_name = $_POST['bbname'];
$field_email = $_POST['bbemail'];
$field_phone = $_POST['bbphone'];
$field_message = $_POST['bbmessage'];
$mail_to = 'me@mydomain.com';
$subject = 'Message from '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Phone: '.$field_phone."\n";
$body_message .= 'Message: '.$field_message;
$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. I will contact you shortly.');
window.location = 'contact.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to me@mail.com');
window.location = 'contact.html';
</script>
<?php
}
?>