Glenskie Posted September 29, 2011 Share Posted September 29, 2011 ok well the email sends but the php values wont show , they just show the actual php code. <?php include('Mail.php'); include('Mail/mime.php'); // Constructing the email $sender = "activate.social@gmail.com"; // Your email address $recipient = "$email1"; // The Recipients name and email address $subject = "complete your registration"; // Subject for the email $text = 'This is a text message.'; // Text version of the email $html = '<html><body>Hi $username, Complete this step to activate your login identity at social Click the line below to activate when ready <a href="http://99.66.134.168/webinter/activation.php?id=$id&sequence=$db_password">Click here to activate your account</a> If the URL above is not an active link, please copy and paste it into your browser address bar Login after successful activation using your: E-mail Address: $email1 Password: $pass1 See you on the site!</body></html>'; // HTML version of the email $crlf = "\n"; $headers = array( 'From' => $sender, 'Return-Path' => $sender, 'Subject' => $subject ); // Creating the Mime message $mime = new Mail_mime($crlf); // Setting the body of the email $mime->setTXTBody($text); $mime->setHTMLBody($html); // Add an attachment // Set body and headers ready for base mail class $body = $mime->get(); $headers = $mime->headers($headers); // SMTP authentication params $smtp_params["host"] = "smtp.gmail.com"; $smtp_params["port"] = "587"; $smtp_params["auth"] = true; $smtp_params["username"] = "activate.social@gmail.com"; $smtp_params["password"] = "pass"; // Sending the email using smtp $mail =& Mail::factory("smtp", $smtp_params); $result = $mail->send($recipient, $headers, $body); ?> Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted September 29, 2011 Share Posted September 29, 2011 use double quotes: $html = "<html><body>Hi $username, Complete this step to activate your login identity at social Click the line below to activate when ready <a href=\"http://99.66.134.168/webinter/activation.php?id=$id&sequence=$db_password\">Click here to activate your account</a> If the URL above is not an active link, please copy and paste it into your browser address bar Login after successful activation using your: E-mail Address: $email1 Password: $pass1 See you on the site!</body></html>"; That way the variables are parsed. Also you then have to escape the double quotes within the string, like where your hyperlink is. Quote Link to comment Share on other sites More sharing options...
Glenskie Posted September 29, 2011 Author Share Posted September 29, 2011 thank you it worked Quote Link to comment Share on other sites More sharing options...
mikesta707 Posted September 29, 2011 Share Posted September 29, 2011 If you are curious as to why your version didn't work, check out this manual page: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double In short, double quotes "interpolate" the inner string, which means instead of the literal string, you get the string with any variables replaced by their values Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.