Re: passing variable through an html email

From: Date: Tue, 15 Jan 2002 19:42:37 +0000
Subject: Re: passing variable through an html email
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15838@lists.php.net to get a copy of this message
On Wednesday 16 January 2002 03:32, Kevin Ruiz wrote: This isn't a db related question! > I'm writing a page that allows me to add users to a table. Once the users > are in the table they will be able to gain access to our downloads section, > they will be validated against their user/pass in a mysql database. > > Here's my question. I understand how to send mail using mail(). I also > understand how to send mail in an html format which is what I'd prefer to > do but what I'm having trouble with is passing my variables to the email > being generated in the html format. This works fine in the plain text > emails but can't seem to get it to work in the html emails. > > Here's my situation...once a new user is added to the database an email is > generated with their user/pass. The code I am using to send them the email > is this: > > ================================================================ > //mails the new account holder his/her username and pass > //for testing purposes I'm sending all mail to myself > /* recipients */ > $to = "Kevin Ruiz <kevin.ruiz@worktiviti.com>"; > > /* subject */ > $subject = "Access to downloads section at Worktiviti.com"; > > /* message */ > $message = ' You're using single quotes to define the $message string thus no variable expansion takes place. I suggest breaking up the assignment into several chunks, for example: $message = 'Hello ' . $name . ', how are you'; hth -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Love is in the offing. -- The Homicidal Maniac */

« previous php.db (#15838) next »