Jump to content

php session and mailto help!


shawnm

Recommended Posts

Hey Everyone,

I was hoping someone could help me out with a little PHP problem. Like many posters, I'm new to the PHP game. What I'm trying to accomplish is to gather information on 3 different forms spread across 3 pages, then process all of the info together and send it as an email to my email address. What I've done so far is linked the 3 pages, making the action on form1 to post to page2.php, etc. On the second and third pages (containing the second and third forms) I've included the following code:

 

session_start();

if(!$_SESSION['ses_request']){$_SESSION['ses_request'] = $_REQUEST;}else{$_SESSION['ses_request'] = array_merge($_SESSION['ses_request'],$_REQUEST);}

 

My submit button on the third form is set to POST to sendmail.php. I've copied the code in the sendmail.php file below:

 

<?

$ForwardTo="myemail@hotmail.com";

$card=$_REQUEST['cardbutton'];

$myclue=$_REQUEST['myclue'];

$mymessage=$_REQUEST['mymessage'];

$name=$_REQUEST['name'];

$address1=$_REQUEST['address1'];

$address2=$_REQUEST['address2'];

$address3=$_REQUEST['address3'];

$city=$_REQUEST['city'];

$state=$_REQUEST['state'];

$zipcode=$_REQUEST['zipcode'];

mail($ForwardTo, "New Order from $name",$card, $myclue, $mymessage, $name, $address1, $address2, $address3, $city, $state, $zipcode);

header("Location: ThankYou.html");

?>

 

When I go to the site and fill out the form everything seems to work fine. The Thank You page even comes up fine, but I don't receive an email with the info. Cah anybody help with this??

 

Thank you in advance.

 

Shawn

 

 

 

 

 

 

 

Link to comment
Share on other sites

your mail has to muc stuff the normal fountion is used this way

 

<?php

 

$Name = "Da Duder"; //senders name

$email = "email@adress.com"; //senders e-mail adress

$recipient = "PersonWhoGetsIt@emailadress.com"; //recipient

$mail_body = "The text for the mail..."; //mail body

$subject = "Subject for reviever"; //subject

$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

 

mail($recipient, $subject, $mail_body, $header); //mail

?>

Link to comment
Share on other sites

Ok so I tried combining some variables as follows but it still doesn't work:

 

<?

$ForwardTo="myemail@hotmail.com";

$card=$_REQUEST['cardbutton'];

$myclue=$_REQUEST['myclue'];

$mymessage=$_REQUEST['mymessage'];

$name=$_REQUEST['name'];

$address1=$_REQUEST['address1'];

$address2=$_REQUEST['address2'];

$address3=$_REQUEST['address3'];

$city=$_REQUEST['city'];

$state=$_REQUEST['state'];

$zipcode=$_REQUEST['zipcode'];

$subject = "New order for $name";

$mailmessage = "$card $myclue $mymessage $name $address1 $address2 $address3 $city $state $zipcode";

mail($ForwardTo, $subject, $mailmessage);

header("Location: ThankYou.html");

?>

 

Any suggestions???

Thanks

 

 

Link to comment
Share on other sites

the fact that you are not receiving the email may not be an issue with PHP code, but an issue of whether your host supports this functionality and/or whether the message is being tagged as spam and stopped.

 

for testing, i suggest that you try something besides a hotmail account.

 

also:

 

mail($ForwardTo, $subject, $mailmessage) or die("mail failed.");

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.