This topic is locked

Replacing 'from' with seession value

3/28/2009 6:44:34 PM
PHPRunner General questions
M
mmponline author

I use the following in the From field to add a reply address. It woks fine.

$email = $_SESSION["ReplyMail"];

mail($email, $subject, $message, 'From: Projects <test@test.com>');


I now need to replace the e-mail address wit a session value so that it puts the session e-mail in the place of test@test.com
Something like this (this does not work off course).

$email = $_SESSION["ReplyMail"];

mail($email, $subject, $message, 'From: Projects <$_SESSION["ReplyMail"]>');


Help appreciated...

M
mmponline author 3/31/2009

Any ideas on this one?

J
Jane 3/31/2009

Hi,
please see my changes below:

$email = $_SESSION["ReplyMail"];

mail($email, $subject, $message, 'From: Projects <'.$_SESSION["ReplyMail"].'>');

M
mmponline author 4/3/2009

Thanks Jane, this is just perfect!