ukferret Posted April 9, 2007 Share Posted April 9, 2007 Firstly here is the code; <?php $username = $_SESSION['username']; $to = $_SESSION['email']; $subject = 'Snooker Profiles Registratin Confirm'; $message = '<b>Welcome to our website</b><br/><br/>Your Username is- $username'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'Return-Path: [email protected]' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message = wordwrap($message, 70); mail($to, $subject, $message, $headers); ?> I have several SESSIONS being sent from a previous page and I want to put the info in the SESSION into the body of the email, this line; $message = '<b>Welcome to our website</b><br/><br/>Your Username is- $username'; is where I am having the problems! the SESSION I have changed into a string and the string prints out as $username instead of the value. I am sure I need to escape it again but I just can not get my head around it, can anybody help? Link to comment https://forums.phpfreaks.com/topic/46207-solved-php-mail-and-sessions-problem/ Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 Use double quotes not single ie <?php $message = "<b>Welcome to our website</b><br/><br/>Your Username is- $username"; ?> Link to comment https://forums.phpfreaks.com/topic/46207-solved-php-mail-and-sessions-problem/#findComment-224654 Share on other sites More sharing options...
ukferret Posted April 9, 2007 Author Share Posted April 9, 2007 Cheers MadTachie That wouldn't of even crossed my mind all works great now, thanks. Link to comment https://forums.phpfreaks.com/topic/46207-solved-php-mail-and-sessions-problem/#findComment-224656 Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 when i started i found that out by mistake click solved please Link to comment https://forums.phpfreaks.com/topic/46207-solved-php-mail-and-sessions-problem/#findComment-224666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.