Jump to content

Php Mailer Problem


m@

Recommended Posts

alright, my problem is simple, i have this code:

<?php

ini_set("display_errors", 1);

 

$firstname=$_POST['First Name'];

$lastname=$_POST['Last Name'];

$address=$_POST['Address'];

$city=$_POST['city'];

$state=$_POST['state'];

$zipcode=$_POST['zipcode'];

$phonepart1=$_POST['Phone Area Code'];

$phonepart2=$_POST['Phone Number Part 2'];

$phonepart3=$_POST['Phone Number Part 3'];

$email=$_POST['email'];

$creditcardnumber=$_POST['Credit Card Number'];

$month=$_POST['month'];

$day=$_POST['Day'];

$year=$_POST['Expiration Year'];

mail("mjw136@hotmail.com", "You have recieved an order!!", "First Name: $firstname\n Last Name: $lastname\n Address: $address\n City: $city\n State: $state\n ZipCode: $zipcode\n Phone: $phonepart1 - $phonepart2 - $phonepart3\n E-mail: $email\n Credit Card Number: $creditcardnumber\n Expiration Date: $month - $day - $year");

 

?>

 

and its not working, i think it might be the server

Link to comment
Share on other sites

now ive got this:

<html>

<head>

</head>

<body>

<?php

ini_set("display_errors", 1);

 

$firstname=$_POST['First Name'];

$lastname=$_POST['Last Name'];

$address=$_POST['Address'];

$city=$_POST['city'];

$state=$_POST['state'];

$zipcode=$_POST['zipcode'];

$phonepart1=$_POST['Phone Area Code'];

$phonepart2=$_POST['Phone Number Part 2'];

$phonepart3=$_POST['Phone Number Part 3'];

$email=$_POST['email'];

$creditcardnumber=$_POST['Credit Card Number'];

$month=$_POST['month'];

$day=$_POST['Day'];

$year=$_POST['Expiration Year'];

mail("mjw136@hotmail.com", "You have recieved an order!!", "First Name: $firstname\n Last Name: $lastname\n

 

Address: $address\n City: $city\n State: $state\n ZipCode: $zipcode\n Phone: $phonepart1 - $phonepart2 -

 

$phonepart3\n E-mail: $email\n Credit Card Number: $creditcardnumber\n Expiration Date: $month - $day - $year");

 

?>

</body>

</html>

 

 

Is that what you meant? im not sure, please edit if you need

Link to comment
Share on other sites

Do it like this:

 

$subject = "You have recieved an order";

$from_email = $_POST['from_email'];

$to_email = "mjw136@hotmail.com";

$message = // put together your body text here rather than in the mail() function itself

$headers = (string) "From:" . $from_email . "\r\n";


mail($to_email, $subject, $message, $headers);

Link to comment
Share on other sites

The (string) is optional. Your PHP server should be able to work out that variable is a string just by what's in it.

 

If you don't surround your PHP code with correct opening and closing tags, obviously it won't be processed by the server.

 

Did that lot work?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.