value doesn't show up using mail()

They have: 164 posts

Joined: Nov 2001

hi, i'm using mail() tat is why i put everything in this way,

<?php
$msg
=  \"<b>$user_realname</b><br><br>\";
$msg .=  \"$user_address<br>\";
$msg .= state_text($user_state);
$msg .=  \", $user_zip<br>\";
$msg .= country_text($user_country);
$msg .=  \"<br><br>Phone : $user_tel<br>\";
$msg .=  \"Email : $user_email\";
$msg .=  \"</td>\";

mail(
$recipient, $subject, $msg, $headers);
?>

when i receive mail, i found tat it is display in this way:

Quote:
Joyce

Kelana Jaya
, 47301

Phone : 0312345678
Email : [email protected]

the value of the state and country is not there. i tried echo the value in this way:

<?php
$abc
= state_text($user_state);
echo
$abc;
?>

and i can get the value. but it just can't seems to show up when i receive my mail. anybody know wat is wrong? pls advice!! thanks.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Do those functions return a value or print it?

<?php
mail
($recipient, $subject, $msg, $headers);
echo
$msg;
?>
Try printing $msg the same time you send the mail. Then compair.

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.