Jump to content

Stuck on my email form... HELP


AstrosMF

Recommended Posts

Hey everyone... i'm having a hell of a time getting this form to work... basically the below variables are being grabbed from "sb_signup.php" and being sent to "sb_confirmation.php" ... i've got the "sb_signup" page down but need help on the processing... i've got the code to grab the info but need help on the acutal sending portion

 

I am trying to get it sent to an email address in a decent format... anyone willing to help a noob?  thanks everyone

$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$address_1 = $_REQUEST['address_1'];
$address_2 = $_REQUEST['address_2'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$home1 = $_REQUEST['home1'];
$home2 = $_REQUEST['home2'];
$home3 = $_REQUEST['home3'];
$cell1 = $_REQUEST['cell1'];
$cell2 = $_REQUEST['cell2'];
$cell3 = $_REQUEST['cell3'];
$email = $_REQUEST['email'];
$gender = $_REQUEST['gender'];
$shirt = $_REQUEST['shirt'];
$number = $_REQUEST['number'];
$position = $_REQUEST['position'];
$returning = $_REQUEST['returning'];
$skill = $_REQUEST['skill'];
$play = $_REQUEST['play'];
$comments = $_REQUEST['comments'];

Link to comment
https://forums.phpfreaks.com/topic/42804-stuck-on-my-email-form-help/
Share on other sites

use mysql database and query INSERT INTO

to put it into your database, you can have many if/else statements on success statements..

how you want to insert/update it into the mysql database

 

there are many tutorials explaining how to query and insert values into a mysql database

especially on the subject of form processing, google it and look in phpfreaks tuts

 

if you have questions or problems specifically with the code, after you've tried or compiled something together, let us know :)

 

*edit woops i misread what you were looking to do, ignore this

This is useful link to send an email. I have a problem though. The problem so far is I can't send to hotmail's users. Hotmail takes those emails as spam. Their SpamFilter is very strong.

 

http://www.phpfreaks.com/forums/index.php/topic,131516.0.html

 

I have been trying to figure out to send emails too, but got no result so far. Take a look at the thread and read it. It is useful.

 

HTH

simple text... just formated to look nicely... thanks so much for your help!!

 

Try this for mail:

$message = "G'Day!

Your personal account for the Straight-a program
has been created! Your personal username and 
password are as follows:
    (Add here all variables u want to send to user) 
    Uasename : " . $first_name . "
    Email : " . $email  . "
    And so on.......
    
To log in, proceed to the following address:  
   
       Ur site name address here

You aren't stuck with this password! Your can
change it at any time after you have logged in.

If you have any problems, feel free to contact me at
<[email protected]>.


Webmaster
";

thanks mmarif4u for the reply... while you were replying i tried the below code

<?php
$to = "[email protected]"; //and yes i put my real email address
$subject = "Softball Sign-up Submission";
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$address_1 = $_REQUEST['address_1'];
$address_2 = $_REQUEST['address_2'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$home1 = $_REQUEST['home1'];
$home2 = $_REQUEST['home2'];
$home3 = $_REQUEST['home3'];
$cell1 = $_REQUEST['cell1'];
$cell2 = $_REQUEST['cell2'];
$cell3 = $_REQUEST['cell3'];
$email = $_REQUEST['email'];
$gender = $_REQUEST['gender'];
$shirt = $_REQUEST['shirt'];
$number = $_REQUEST['number'];
$position = $_REQUEST['position'];
$returning = $_REQUEST['returning'];
$skill = $_REQUEST['skill'];
$play = $_REQUEST['play'];
$comments = $_REQUEST['comments'];

$mailheaders = "First Name: $first_name\r\n";
$mailheaders .= "Last Name: $last_name\r\n";
$mailheaders .= "Address Line 1: $address_1\r\n";
$mailheaders .= "Address Line 2: $address_2\r\n";
$mailheaders .= "City: $city\r\n";
$mailheaders .= "State: $state\r\n";
$mailheaders .= "Zip Code: $zip\r\n";
$mailheaders .= "Home Phone Number: $home1\r\n";
$mailheaders .= "Cell Phone Number: $cell1\r\n";
$mailheaders .= "Email Address: $email\r\n";
$mailheaders .= "Gender: $gender\r\n";
$mailheaders .= "Shirt Size: $shirt\r\n";
$mailheaders .= "Jersey Number: $number\r\n";
$mailheaders .= "Position: $position\r\n";
$mailheaders .= "Returning Player: $returning\r\n";
$mailheaders .= "Skill Level: $skill\r\n";
$mailheaders .= "Ready to Play?: $play\r\n";
$mailheaders .= "Comments: $comments";
$headers = "From: <$email>\n";

mail($to, $subject, $mailheaders, $headers, "Reply-to: <$email>");
?>

I am not getting the email..... any ideas??

try This...

<?php
$to = "[email protected]"; //and yes i put my real email address
$subject = "Softball Sign-up Submission";
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$address_1 = $_REQUEST['address_1'];
$address_2 = $_REQUEST['address_2'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$home1 = $_REQUEST['home1'];
$home2 = $_REQUEST['home2'];
$home3 = $_REQUEST['home3'];
$cell1 = $_REQUEST['cell1'];
$cell2 = $_REQUEST['cell2'];
$cell3 = $_REQUEST['cell3'];
$email = $_REQUEST['email'];
$gender = $_REQUEST['gender'];
$shirt = $_REQUEST['shirt'];
$number = $_REQUEST['number'];
$position = $_REQUEST['position'];
$returning = $_REQUEST['returning'];
$skill = $_REQUEST['skill'];
$play = $_REQUEST['play'];
$comments = $_REQUEST['comments'];

$headers = 'From: $email' . "\r\n" .
   'Reply-to: $email' . "\r\n" .
   'MIME-Version: 1.0' . "\r\n".
   'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();
    $message = "G'Day!

(Add ur text here):

    First Name : " . $first_name . "
    Last Name : " . $last_name . "
    Address 1 : " . $address_1 . "
    Address 2 : " . $address_2 . "
    City : " . $city . "
    State : " . $state . "
    Zip : " . $zip . "
    Home 1 : " . $home1 . "
    Home 2 : " . $home2 . "
    Home 3 : " . $home3 . "
    Cell 1 : " . $cell1 . "
Cell 1 : " . $cell2 . "
Cell 2 : " . $cell3 . "
Cell 3 : " . $email . "
Gender : " . $gender . "
Shirt : " . $shirt . "
Number : " . $number . "
Position : " . $position . "
Returning : " . $returning . "
Skill : " . $skill . "
Play : " . $play . "
Comments: " . $comments . "
    
    
To log in, proceed to the following address:  
   
       (Ur site url)

(Some text)

If you have any problems, feel free to contact me at
<[email protected]>.


Webmaster
";

    mail($to ,$subject,$message, $headers);
?>

 

change some thing if required to ur design.

 

I hope this will help u.

k... used your code and the email now sends... but the email is coming in one string instead of line breaking after every variable... what should i add?

 

edit:

also the email address it showing that it is coming from is

"[email protected]" <[email protected]>

so far this is the code i have and it's working fine... except the email is coming in all one line... what do i need to tweak to break the lines?  thanks!!!

<?php
$to = "[email protected]"; //and yes i put my real email address
$subject = "Softball Sign-up Submission";
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$address_1 = $_REQUEST['address_1'];
$address_2 = $_REQUEST['address_2'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$home_1 = $_REQUEST['home_1'];
$home_2 = $_REQUEST['home_2'];
$home_3 = $_REQUEST['home_3'];
$cell_1 = $_REQUEST['cell_1'];
$cell_2 = $_REQUEST['cell_2'];
$cell_3 = $_REQUEST['cell_3'];
$email = $_REQUEST['email'];
$gender = $_REQUEST['gender'];
$shirt = $_REQUEST['shirt'];
$number = $_REQUEST['number'];
$position = $_REQUEST['position'];
$returning = $_REQUEST['returning'];
$skill = $_REQUEST['skill'];
$play = $_REQUEST['play'];
$comments = $_REQUEST['comments'];

$headers = 'From: $email' . "\r\n" .
   'Reply-to: $email' . "\r\n" .
   'MIME-Version: 1.0' . "\r\n".
   'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();
    $message = "

    Name : " . $first_name . " " . $last_name . "
Address 1 : " . $address_1 . " " . $address_2 . "
City : " . $city . ", " . $state . " " . $zip . "
Home : (" . $home_1 . ") " . $home_2 . "-" . $home_3 . "
Cell : (" . $cell_1 . ") " . $cell_2 . "-" . $cell_3 . "
Email : " . $email . "
Gender : " . $gender . "
Shirt : " . $shirt . "
Number : " . $number . "
Position : " . $position . "
Returning : " . $returning . "
Skill : " . $skill . "
Play : " . $play . "
Comments: " . $comments . "
";

    mail($to ,$subject,$message, $headers);
?>

$email = $_REQUEST['email'];

If the above email is coming from user form then change ur this (From:ur email) in the headers.

About line breaking i am using this type of message and its ok,,,

 

Change ur design of message or show me  ur latest code...

Show me the sample which type of email u recieve.

Name : Michael Forbes Address 1 : Spring Park Center Blvd Apt 8208 City : Spring, TX 77373 Home : (832) xxx-xxxx Cell : (xxx) xxx-xxx Email : [email protected] Gender : male Shirt : XL Number : 7 Position : 1B Returning : yes Skill : competitive Play : Yes! Sign-Me Up to Play Comments: thanks

now down to this code... but still no worky...  ???

<?php
$to = "[email protected]"; //and yes i put my real email address
$subject = "Softball Sign-up Submission";
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$address_1 = $_REQUEST['address_1'];
$address_2 = $_REQUEST['address_2'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$home_1 = $_REQUEST['home_1'];
$home_2 = $_REQUEST['home_2'];
$home_3 = $_REQUEST['home_3'];
$cell_1 = $_REQUEST['cell_1'];
$cell_2 = $_REQUEST['cell_2'];
$cell_3 = $_REQUEST['cell_3'];
$email = $_REQUEST['email'];
$gender = $_REQUEST['gender'];
$shirt = $_REQUEST['shirt'];
$number = $_REQUEST['number'];
$position = $_REQUEST['position'];
$returning = $_REQUEST['returning'];
$skill = $_REQUEST['skill'];
$play = $_REQUEST['play'];
$comments = $_REQUEST['comments'];

$headers = 'From: ' . $email . "\r\n" .
   'Reply-to: $email' . "\r\n" .
   'MIME-Version: 1.0' . "\r\n".
   'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();
    $message = "Name : " . $first_name . " " . $last_name . "\r\n";
$message .= "Address : " . $address_1 . " " . $address_2 . "\r\n";
$message .= "City : " . $city . ", " . $state . " " . $zip . "\r\n";
$message .= "Home : (" . $home_1 . ") " . $home_2 . "-" . $home_3 . "\r\n";
$message .= "Cell : (" . $cell_1 . ") " . $cell_2 . "-" . $cell_3 . "\r\n";
$message .= "Email : " . $email . "\r\n";
$message .= "Gender : " . $gender . "\r\n";
$message .= "Shirt : " . $shirt . "\r\n";
$message .= "Number : " . $number . "\r\n";
$message .= "Position : " . $position . "\r\n";
$message .= "Returning : " . $returning . "\r\n";
$message .= "Skill : " . $skill . "\r\n";
$message .= "Play : " . $play . "\r\n";
$message .= "Comments: " . $comments;

    mail($to ,$subject,$message, $headers);
?>

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.