Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong with this

Status
Not open for further replies.

krappleby

Programmer
Jul 25, 2006
25
GB
i am trying to replace certain words in the email with replacement words, but its not working, i am getting the email but the words are staying as is..

any help would be appreciated


$get_email = "Select * From Site_Emails where EMAIL_CODE = 'WELCOME EMAIL'";
$email_result = mysql_query($get_email);
$email_row = mysql_fetch_array($email_result);

$subject = $email_row['EMAIL_SUBJECT'];
$body = $email_row['EMAIL_CONTENT'];

str_replace('%SITENAME%', $admininfo_row['SITE_NAME'], $subject);
str_replace('%SITENAME%', $admininfo_row['SITE_NAME'], $body);
str_replace('%SITEURL%', $admininfo_row['SITE_URL'], $body);
str_replace('%VERIFYCODE%', $RANDOM_NUM, $body);


$to = $EMAIL_ADDRESS;

$from = "From: " . $admininfo_row['ADMIN_EMAIL'];
if (mail($to, $subject, $body, $from))
 
Try this:
Code:
$get_email = "Select * From Site_Emails where EMAIL_CODE = 'WELCOME EMAIL'";
$email_result = mysql_query($get_email);
$email_row = mysql_fetch_array($email_result);
$subject = $email_row['EMAIL_SUBJECT'];
$body = $email_row['EMAIL_CONTENT'];
                
$subject = str_replace('%SITENAME%', $admininfo_row['SITE_NAME'], $subject);
$body = str_replace('%SITENAME%', $admininfo_row['SITE_NAME'], $body);
$body = str_replace('%SITEURL%', $admininfo_row['SITE_URL'], $body);
$body = str_replace('%VERIFYCODE%', $RANDOM_NUM, $body);
$to = $EMAIL_ADDRESS;
$from = "From: " . $admininfo_row['ADMIN_EMAIL'];
if (mail($to, $subject, $body, $from))

Take Care,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top