Page 1 of 1

Sending Email Form

Posted: Wed May 20, 2009 5:59 pm
by millsy007
Hi
I have some code that sends a form:

Code: Select all

 
$name = trim($_GET['name']); //The senders name
$email = trim($_GET['email']); //The senders email address
$subject = trim($_GET['subject']); //The senders subject
$message = trim($_GET['msg']); //The senders message
 
mail($to,$subject,$message,"From: ".$email.""); //a very simple send
 
It works fine but I am trying to make some changes to it but when I do it stops working :(

What I want to do is change the subject of the email to say 'Enquiry'
And have the subject text that is passed in be added as part of the message (this will actually hold the users brief summary)
Any help would be appreciated as my attempt didnt send the mail.

Re: Sending Email Form

Posted: Wed May 20, 2009 6:10 pm
by deejay
this is what i'd try -

Code: Select all

 
$name = trim($_GET['name']); //The senders name
$email = trim($_GET['email']); //The senders email address
$subject = 'Subject:';
$subject_to_add = trim($_GET['subject']); //The senders subject
$message = trim($_GET['msg']); //The senders message
$message = "$subject_to_add  
 
$message";
 
hope that helps.

Re: Sending Email Form

Posted: Wed May 20, 2009 6:15 pm
by millsy007
Thanks, but doesnt seem to work, is there something missing from:

Code: Select all

$message = "$subject_to_add  
 
$message";