943,022 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 359
  • PHP RSS
Jul 29th, 2010
0

PHP Form Mail Not Working...

Expand Post »
I am super new at coding PHP, and ive gotten this to work in the past, but for some reason it isn't working now. Can someone tell me what im doing wrong. Thank you so much in advance!

PHP Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3. $email = $_POST['email'];
  4. $firstname = $_POST['firstname'];
  5. $lastname = $_POST['lastname'];
  6. $addressone = $_POST['addressone'];
  7. $addresstwo = $_POST['addresstwo'];
  8. $creditcard = $_POST['creditcard'];
  9. $city = $_POST['city'];
  10. $state = $_POST['state'];
  11. $zip = $_POST['zip'];
  12. $creditcard = $_POST['creditcard'];
  13. $cvc = $_POST['cvc'];
  14. $month = $_POST['month'];
  15. $year = $_POST['year'];
  16. $billingagree = $_POST['billingagree'];
  17. $design = $_POST['design'];
  18. $billingone = $_POST['billingone'];
  19. $billingtwo = $_POST['billingtwo'];
  20. $city2 = $_POST['city2'];
  21. $state2 = $_POST['state2'];
  22. $cardtype = $_POST['cardtype'];
  23. $cardname = $_POST['cardname'];
  24. $gender = $_POST['gender'];
  25. $postmark = $_POST['postmark'];
  26. $letter = $_POST['letter'];
  27. $postmark2 = $_POST['postmark2'];
  28. $verify = $_POST['verify'];
  29. $gift = $_POST['gift'];
  30. $lastyeargift = $_POST['lastyeargift'];
  31. $extranotes = $_POST['extranotes'];
  32. $accomplishments = $_POST['accomplishments'];
  33.  
  34. $ToEmail = "email@myemail.com";
  35. $ToSubject = "New Order!";
  36.  
  37. $body = "First Name: $firstname\n Last Name: $lastname\n Address: \n $addressone\n $addresstwo\n $city, $state $zip\n Wrote their own letter details\n Letter:\n $letter \n Which postmark: $postmark \n Details for us to write the letter: \n Gender: $gender \n Gift they want this year: $gift \n Last years gift: $lastyeargift \n Accomplishments this year: \n $accomplishments \n Extra notes: \n $extranotes \n Which postmark: $postmark2 \n Do they want a proof: $verify \n Billing Information: \n Name on Card: $cardname \n Card Type: $cardtype \n Card Number: $creditcard \n CVC: $cvc \n Expires: $month, $year \n Billing Address (If different from Shipping Address): \n $billingone \n $billingtwo \n $city2, $state2 $zip2 \n Email: $email \n Did they agree to the billing terms: $billingagree";
  38.  
  39. $headers .= "Content-type: text; charset=iso-8859-1\r\n";
  40. $headers .= "From:"email@myemail.com"\r\n";
  41.  
  42. echo "Thank you for your order $cardname!<br>You will receive an email at $email when we charge your credit card. Remember that the transaction will come across on your credit card statement as PAYPAL *HENRYS PET TA.";
  43. mail($ToEmail,$ToSubject,$body, $headers);
  44.  
  45.  
  46. ?>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
speakerbug is offline Offline
2 posts
since Jul 2010
Jul 29th, 2010
0
Re: PHP Form Mail Not Working...
Hi speakerbug,

what exactly is it that isn't working? Do you get any error messages?


Zagga
Reputation Points: 22
Solved Threads: 50
Posting Whiz in Training
Zagga is offline Offline
225 posts
since Dec 2009
Jul 29th, 2010
0
Re: PHP Form Mail Not Working...
i get a blank screen, and nothing sends. Here, you can try it: http://officialsantamail.net/nosound/order.html
Reputation Points: 10
Solved Threads: 0
Newbie Poster
speakerbug is offline Offline
2 posts
since Jul 2010
Jul 29th, 2010
0
Re: PHP Form Mail Not Working...
Hi again speakerbug,

Try echoing a few of the variables to make sure they are being received from $_POST as you expect.

Have you been able to send email via php before or is this your first try?


Zagga
Reputation Points: 22
Solved Threads: 50
Posting Whiz in Training
Zagga is offline Offline
225 posts
since Dec 2009
Jul 31st, 2010
0
Re: PHP Form Mail Not Working...
Actually u have some syntax error like "From:"email@myemail.com"\r\n";it should be written as "From:email@myemail.com\r\n";
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ankitagalaxy is offline Offline
3 posts
since Jul 2007
Aug 2nd, 2010
0
Re: PHP Form Mail Not Working...
Do you own a Web Design company because a easy to use form creator is, Wufoo.com.
Reputation Points: 9
Solved Threads: 0
Newbie Poster
Flexor123 is offline Offline
4 posts
since Aug 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Syntax error. Need new eyes, I guess...
Next Thread in PHP Forum Timeline: Undefined variable: row





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC