Jump to content

[SOLVED] php mail not working


koolaid

Recommended Posts

??? let me start by saying thank you, and that i am php stupid. I have made php mail work a couple times before, but this time i want my script to send mail to an address that the user inputs. What's wrong with what i am doing?


<?php

$sendTo = .$_POST["email"];
$sendTo2 ="mattpaxton@clearchannel.com";
$subject = "* listing *";  

$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";

$headers .= "Reply-To: " . $_POST["email"] . "\r\n";

$headers .= "Return-path: " "mattpaxton@clearchannel.com"

$message =  $_POST["phone"] . $_POST["message"];

mail($sendTo, $subject, $message, $headers);
mail($sendTo2, $subject, $message, $headers);


?>

 

 

Link to comment
Share on other sites

I put that code in.

I normally would not post in forums when i am this bad at what i am doing. I ordered a couple books so that i may learn the correct way of structuring my code

 

"Foundation PHP 5 for Flash

"PHP Solutions: Dynamic Web Design Made Easy (Solutions)"

 

but i can not wait until they get here. This is the last hurtle i have for this project, and then i will be able to actually learn before i am expected to Implement. I know my code is screwed, but can you tell me where i am going wrong?

 

Link to comment
Share on other sites

this might be right. and mattpaxton@clearchannel.com is probably going to receive an email from my computer.  :)

 

<?php

$sendTo = $_POST["email"];
$sendTo2 ="mattpaxton@clearchannel.com";
$subject = "* listing *";  

$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n";

$headers .= "Reply-To: " . $_POST["email"] . "\r\n";

$headers .= "Return-path: mattpaxton@clearchannel.com\r\n";

$message =  $_POST["phone"] . $_POST["message"];

mail($sendTo, $subject, $message, $headers);
mail($sendTo2, $subject, $message, $headers);


?>

Link to comment
Share on other sites

That did it! Thanks a lot i know it can be frustrating helping people who are completely clueless and unwilling to learn on their own. I assure you if i had any more time i would have made a greater effort to learn on my own. Thanks again man.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.