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 = "[email protected]"; // 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"] = "[email protected]"; $smtp_params["password"] = "pass"; // Sending the email using smtp $mail =& Mail::factory("smtp", $smtp_params); $result = $mail->send($recipient, $headers, $body); ?> Link to comment https://forums.phpfreaks.com/topic/248072-error/ 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. Link to comment https://forums.phpfreaks.com/topic/248072-error/#findComment-1273786 Share on other sites More sharing options...
Glenskie Posted September 29, 2011 Author Share Posted September 29, 2011 thank you it worked Link to comment https://forums.phpfreaks.com/topic/248072-error/#findComment-1273789 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 Link to comment https://forums.phpfreaks.com/topic/248072-error/#findComment-1273790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.