[solved]mail() values not being sent
Posted: 26. April 2012 12:09
Here's a little problem for which I believe the answer is quite simple but maybe I cannot see the wood for the trees:
I have a form which displays data; the user is asked to edit the data which, in turn, updates the database and sends an email with the updated data. The email arrives but although it displays the titles does not display the data.
What am I doing wrong?
Text shown in email:
Name:
Email:
Phone:
php code:
I have a form which displays data; the user is asked to edit the data which, in turn, updates the database and sends an email with the updated data. The email arrives but although it displays the titles does not display the data.
What am I doing wrong?
Text shown in email:
Name:
Email:
Phone:
php code:
- Code: Select all
$email_to = 'someone@here.com';
$name=$row['name'];
$email=$row['email'];
$phone=$row['mobtel'];
$email_subject = 'Feedback from website';
$headers = 'From: someone@there.com\r\n';
$message='Name: ' .$name. "\r\n". 'Email: ' .$email. "\r\n". 'Phone: ' .$phone;
$sent = mail($email_to, $email_subject, $message, $headers);
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }