-1
我已经配置了postfix和我目前在ubuntu,nginx中托管我的网站,我也安装了sendmail以及 因为我完全是新的这个我很高兴约wheather我安装任何其他服务和改变你的任何configurations.thank提前后缀是发送邮件到var /邮件/用户,而不是gmail
<?php
if(isset($_POST['submit'])) {
$name = $_POST['username'];
$email = $_POST['email'];
$number = $_POST['phone'];
$profession = $_POST['profession'];
$to = '[email protected]';
$subject = 'user registration';
$phone = "phone number:".$number;
$message = "client details:"."\n"."Name:".$name."\n"."email:".$email."\n"."phone number:".$number."\n"."profession:".$profession;
$headers = "From:".$email;
if(mail($to, $subject, $message, $headers)) {
header("Location: ../../thankyouNew.html");
} else {
header("Location: ../../somethingWrong.html");
}
}
?>
[PHP的邮件功能不完整的电子邮件发送(可能的重复https://stackoverflow.com/questions/24644436/php-mail-function-不发送完整的电子邮件) – Qirel
我建议你找出为什么你的PHPMailer不能工作。使用该库比使用内置的mail()函数更好。如果您现在使用的代码,它很容易受到头注入。 – Qirel