Problem: Passing Variable to Email $message

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
DoppyNL

Thu Aug 22, 2002 11:28 pm

remember that you're simply building a string that will be send as message from an e-mail.

you can do one of the following (both work)
$variable = ' BUURP';

Code: Select all

$message = 'normal string ' . $variable . ' blablabla';

Code: Select all

$message = "normal string $variable blablabla";


both result in message being:
normal string BUURP blablabla


manual page: http://www.php.net/manual/en/language.types.string.php

Greetz Daan

Jay

Fri Aug 23, 2002 2:07 am

Your problem is here:

Code: Select all

$message = '
<HTML><CENTER><B>
Thank you for Joining our Mail List with the email: <? echo "$to"; ?>
</HTML>';

You're trying to parse PHP when you're already in PHP mode, AND you're attempting to access a variable value within single quotes!

Change it to

Code: Select all

$message = '
<HTML><CENTER><B>
Thank you for Joining our Mail List with the email: '.$to.'</HTML>';

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests