This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

HTML, PHP & POSTFIX
#5
RE: HTML, PHP & POSTFIX
You are using the mail() function wrong in both examples, try this for the second one:
PHP Code:
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$contact=$_REQUEST['contact'];
$service=$_REQUEST['service'];
$budget=$_REQUEST['budget'];
$company=$_REQUEST['company'];
$message=$_REQUEST['message'];
if ((
$name=="")||($email=="")||($contact=="")||($service=="")||($budget=="")||($company=="")||($message=="")){
echo 
"All fields are required, please fill <a href=\"\">the form</a> again.";
}else{ 
       
$to  
"quotes@mydomain.co.za";
$subject  "the subject";
$message2 "name: $name \r\n".
"E-mail: $email \r\n".
"Contact: $contact \r\n".
"service: $service \r\n".
"budget: $budget \r\n".
"Company: $company \r\n".
"message: $message";
$headers        "From: $name <$email>\r\nReturn-path: $email
."X-Mailer: PHP/" phpversion();
if(
mail($to$subject$message2$headers)){
echo 
"Sent!";
}else{
echo 
"fail!";
}

this one i tested.

AND ITS VERY INSECURE, don't use it on a production server/website!

P.S. if the first one worked, even if you use the wrong variables in the mail() function you can say it issent a server problem.
I think..

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:


Messages In This Thread
HTML, PHP & POSTFIX - by kamzo - 12-18-2016, 11:20 PM
RE: HTML, PHP & POSTFIX - by Ron-e - 12-18-2016, 11:50 PM
RE: HTML, PHP & POSTFIX - by Ron-e - 12-18-2016, 11:51 PM
RE: HTML, PHP & POSTFIX - by kamzo - 12-19-2016, 05:43 AM
RE: HTML, PHP & POSTFIX - by Ron-e - 12-19-2016, 02:24 PM
RE: HTML, PHP & POSTFIX - by Ron-e - 12-19-2016, 02:27 PM
RE: HTML, PHP & POSTFIX - by kamzo - 12-19-2016, 10:00 PM
RE: HTML, PHP & POSTFIX - by Me.B - 12-19-2016, 06:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
1.0.2 1.0.3 postfix fix not work andykimpe 20 30 ,633 06-12-2021, 09:54 PM
Last Post: andykimpe
Postfix relay specific domains to mailjet johnnyp 0 2 ,380 01-29-2021, 04:44 AM
Last Post: johnnyp
Site Not Updating changes made in The HTML file me7leelee 4 9 ,316 05-20-2020, 06:29 PM
Last Post: 5050

Forum Jump:


Users browsing this thread: 1 Guest(s)