如何设置 SMTP 服务器以将电子邮件发送为 *@mydomain.com?
然后,我如何将这个 SMTP 服务器与 PHP 脚本一起使用,该脚本从我的网站的联系表单中获取发布的数据并将其作为电子邮件发送给我?
我使用的是 Ubuntu 13.10 和 webmin,但我可以在服务器本地进行更改。
这是我的 PHP 脚本..
#!/var/www/php
<?php
if(isset($_POST['email'])) {
$email_to = "havok@havoksecurity.com";
$email_subject = "havok security contact form";
function died($error) {
// your error code can go here
echo "We are very sorry, but there was an error found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
} …Run Code Online (Sandbox Code Playgroud)