Forum Moderators: coopster

Message Too Old, No Replies

variable in an email

mail() function that is

         

coolo

6:42 am on Jun 19, 2004 (gmt 0)

10+ Year Member



So, say I want to send an automatic email using php. And say I want the content of the email to be personal. I would need a variable (say the person's name) in the message of the email. Would this work?

example:
$name = "Roger";
$message = "Dear $name, thanks for signing up.";

Assuming you put the $message variable in the right spot in the mail function would the email message display the value of the variable?

Zipper

10:28 am on Jun 19, 2004 (gmt 0)

10+ Year Member



$name = "Roger";
$message = "Dear ".$name.", thanks for signing up.";

mail("recipient@domain.com","Subject","$message","From: sender@domain.com");