Jump to content

Email Script


paulgain

Recommended Posts

Hi Everyone,

 

I have wrote a Flex website and on the site I have a "Contact us" page. On this page is a form (no HTML) for the user to fill in their details, I also validate their details before sending them off. I do not want to use a HTML form as it's ugly.

 

I am using a HTTP POST to send the users details to my PHP Script for processing. I want the script to simply pull out the users details and then email me. I have seen plenty of examples of using a HTML form and corresponding mail script, but like i've already said I don't want to use a HTML form.

 

I have set up an Apache web server and configured PHP and it all works as expected when I call phpInfo(). I need help with the script as I have no experience in PHP whatsoever. I would like to do the following:

 

(1) Pullout the users details which are "firstname", "lastname" "contactnumber" "emailaddress" and "message".

(2) Email me with those details, that's it. 

 

I would like a response to indicate success/failure but not as a HTML page.

 

Cheers

 

Paul

 

 

Link to comment
https://forums.phpfreaks.com/topic/173647-email-script/
Share on other sites

if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail( "[email protected]", "Subject: $subject",
  $message, "From: $email" );
  echo "Thank you for using our mail form";
  }

 

It's pretty straightforward, you should be able to figure it out from there

Link to comment
https://forums.phpfreaks.com/topic/173647-email-script/#findComment-915326
Share on other sites

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.