Mail Script Problems


Posted on 16th Feb 2014 07:03 pm by admin

I have created a PHP mail script. I am having a problem though. In $body i am trying to put two values side by side like so $Fname $Lname. Where ever i use
tag the values appear in the final message but where i place the values side by side without a
tag then the values do not appear in the final message. I have already tried encasing the values in quotes and separating them with commas with no luck. I am certain this is an easy fix but i just don't know how. Any ideas.....please!!!

Here is my code:
Code: <?php
if (isset($_POST) && !empty($_POST['Fname'])){
session_start();
$_SESSION['Fname'] = $_POST['Fname'];
}
if (isset($_POST) && !empty($_POST['Lname'])){
session_start();
$_SESSION['Lname'] = $_POST['Lname'];
}
if (isset($_POST) && !empty($_POST['email'])){
session_start();
$_SESSION['email'] = $_POST['email'];
}
if (isset($_POST) && !empty($_POST['phone'])){
session_start();
$_SESSION['phone'] = $_POST['phone'];
}
if (isset($_POST) && !empty($_POST['attend'])){
session_start();
$_SESSION['attend'] = $_POST['attend'];
}
if (isset($_POST) && !empty($_POST['number'])){
session_start();
$_SESSION['number'] = $_POST['number'];
}
if (isset($_POST) && !empty($_POST['trans'])){
session_start();
$_SESSION['trans'] = $_POST['trans'];
}
?>
<?php



/*subject and email variables*/
$emailSubject = 'Survivor or Care Provider Registration';

/*gathering data variables*/
$FnameField = $_POST['Fname'];
$LnameField = $_POST['Lname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$attendField = $_POST['attend'];
$numberField = $_POST['number'];
$transField = $_POST['trans'];
$attend = implode(', ', $attendField);
$trans = implode(', ', $transField);

/*email field*/

$body = <<<EOD

<hr>

<h2>Registration Confirmation Email</h2>
<hr>
Name Registered: $Fname $Lname

Email Address: $email

Phone Number: $phone

Attending As: $attend

Bringing $number including $Fname $Lname

Will $Fname $Lname need transportation: $trans



Thank you for registering!

EOD;

/*email sender script*/
$sendto = $_POST['email'];
$headers = "From: auto-confirm@xxxxxxxxxxxx.comrn";
$headers .= "Bcc: webmaster@xxxxxxxxxxxx.comrn";
$headers .= "Content-type: text/htmlrn";
$success = mail($sendto, $emailSubject, $body, $headers);

/*resultes*/
$theResults = <<<EOD
<html>
<body>
Thanks!
</body>
</html>
EOD;
echo "$theResults";

?>

No comments posted yet

Your Answer:

Login to answer
345 Like 7 Dislike
Previous forums Next forums
Other forums

problem with script manager
Hi iam using Net.2005.I have created ajax enabledwebsite.i have master page in which i have script m

Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato

CHMOD script
Hi,

I need a script to read all files in a folder and set to 777.

Can anyone help out

add 20 000 to the rowcnt
Hi ...
I need to add 20 000 to the row count but just cant find a way to do this i am new to php

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

Transferring session variables into MySQL
I am trying to transfer $_SESSION variables into MySQL. However there is an error in my MySQL statem

How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [

problems with php variables in mysql query
i can't seem to get the following query to work.

select $q1c from $vote_rate where id = $re

I need an iframe that calls up a different page according to the date
hi

I don't know any php (only html) and I urgently need to do the following:

I need a

Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash