Jump to content

SoapLady

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SoapLady's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It does seem like that would work ... but it doesn't! I still get the email with $username in the text, rather than the value assigned in the function. Any other ideas? SoapLady
  2. I have a MySQL table with various email messages I want to send out.  (Want to do it that way so they can be edited in our Admin area). Example:  Table: Email  FieldName:  Email_content [color=red]<p>Dear $firstname,</p> <p>We received a request to send you your login information.  It is as follows:</p> <p>username: <b>$username</b></p> <p>password: <b>$password</b></p>[/color] Once I get the data (via SELECT query), I can access it fine, but can't get the variables replaced by the values (which come from $_SESSION array). This DOES NOT work; the text with  $username and $password unreplaced shows up in the email. [code]<snipped from inside class> [SELECT QUERY] $row = mysql_fetch_array($result) $this->mailText = $row[email_content]; function __construct($firstname, $username, $password) { $this->htmlContent = "$this->mailText"; } // $this->htmlContent is then passed to the email sending function <end snippet>[/code] However, if I do the exact same thing but put the TEXT in the function, the variables are replaced and the email is correct: [code]function __construct($firstname, $username, $password) { $this->htmlContent = "<p>Dear $firstname,</p> <p>We received a request to send you your login information.  It is as follows:</p> <p>username: <b>$username</b></p> <p>password: <b>$password</b></p>"; } [/code] I'm sure there is something fairly simple I need to do, I just can't figure out what it is! Help would be appreciated. SoapLady
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.