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 ="[email protected]";
$subject = "* listing *";  

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

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

$headers .= "Return-path: " "[email protected]"

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

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


?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/
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?

 

this might be right. and [email protected] is probably going to receive an email from my computer.  :)

 

<?php

$sendTo = $_POST["email"];
$sendTo2 ="[email protected]";
$subject = "* listing *";  

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

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

$headers .= "Return-path: [email protected]\r\n";

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

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


?>

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.

Archived

This topic is now archived and is closed to further replies.

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