# Including variables in a HTML email using PHP Mail

**URL:** <https://forum.kirupa.com/t/including-variables-in-a-html-email-using-php-mail/107478>\
**Category:** Uncategorized\
**Created:** [April 15, 2004, 7:00pm UTC](https://forum.kirupa.com/t/including-variables-in-a-html-email-using-php-mail/107478 "2004-04-15T19:00:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheddar](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/cheddar/32/267_2.png) [@cheddar](https://forum.kirupa.com/u/cheddar)\
**Post date:** [April 15, 2004, 7:00pm UTC](https://forum.kirupa.com/t/including-variables-in-a-html-email-using-php-mail/107478/1 "2004-04-15T19:00:50Z")

</div>

Does anyone know how I can go about including variables in a HTML Email sent using PHP mail.

I know how I can setup the mail function to send html emails and I have got that working fine. What I can’t do is figure out how to include variables within the message that gets posted.

The code below is what I send, it works fine but I want to include some information stored in some variables. For example I have the following variable $name , how can I include this within the message. I have tried adding it but instead of sending the value of name, it just send the text $name.

```php

$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr><td>
</td></tr>
</table>
</body>
</html>
';

```

I have done a search of the forums but I still cant work it out. Can anyone help me out here?
