Jump to content

What extra code is needed please?


_Chris

Recommended Posts

   //make connection with mysql and select the database
$mysql_connect = mysql_connect($host, $mysql_user, $mysql_password) ;
if(!$mysql_connect) {echo ("<P>Connection issues. No results displayed.</P>");}
$db_select = mysql_select_db($mysql_db);
if(!$db_select) {echo ("<P>Connection issues. No results displayed.</P>");}

$subject = "Subject Text";
$body = "Body text;
$event_date = '2015-01-31';    //Y-m-d FORMAT

but I would also like to put into the email at the beginning:
Hi first_name, (with the comma and then a couple of line spaces within the $body)
In the mysql the first name is listed as first_name, so I would want the email to automatically insert the recipients first name at the beginning, at the top of the email. How do you do that please?

Dez.

 

Link to comment
Share on other sites

Do a query to retrieve the user's name fields. Start the body variable with the "Hi (name_field),\n\n" and then add more text to that message body.

 

PS - You really should be using a different sql interface since MYSQL_* functions are all DEPRECATED. Please refer to the manual if you don't believe me. IMHO - you should learn PDO.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.