How can I add the html code to mail?



  • There's a code like this:

    if(pligg_validate()){
        $encode=md5($_POST['email'] . $user->karma .  $user->username. pligg_hash().$main_smarty->get_config_vars('PLIGG_Visual_Name'));
    
    $domain = $main_smarty->get_config_vars('PLIGG_Visual_Name');           
    $validation = my_base_url . my_pligg_base . "/validation.php?code=$encode&uid=".urlencode($user->username)."&email=".urlencode($_POST['email']);
    $str = $main_smarty->get_config_vars('PLIGG_PassEmail_verification_message');
    eval('$str = "'.str_replace('"','\"',$str).'";');
    $message = "$str";
    
    if(phpnum()>=5)
      require("libs/class.phpmailer5.php");
    else
      require("libs/class.phpmailer4.php");
    $mail = new PHPMailer();
    $mail->From = $main_smarty->get_config_vars('PLIGG_PassEmail_From');
    $mail->FromName = $main_smarty->get_config_vars('PLIGG_PassEmail_Name');
    $mail->AddAddress($_POST['email']);
    $mail->AddReplyTo($main_smarty->get_config_vars('PLIGG_PassEmail_From'));
    $mail->IsHTML(false);
    $mail->Subject = $main_smarty->get_config_vars('PLIGG_PassEmail_Subject_verification');
    $mail->Body = $message;
    $mail->CharSet = 'utf-8';
    

    PLIGG_PassEmail_verification_message - it's a routine record of registration in the language file.

    "Hello $username,\r\n\r\nWe've sent you this email because you signed up for a new account on $domain. If you didn't mean to do that, you can safely ignore this message.\r\n\r\nVisit this link to activate your account:\r\n $validation \r\n\r\nYour Password is $password \r\n\r\nIf clicking the link doesn't work, copying the complete link address into your browser.\r\nStill having trouble? Contact us at $contactmail\r\n\r\nAfter activation of your account, you can login at $my_base_url$my_pligg_base\r\n\r\nEnjoy!\r\n\r\nThe Administrator"

    Which is right http://pastebin.com/DYcBkaZp html code?



  • Look at the headings of the letter, must be Content-Type: text/html; You can look at the headings in gmail by choosing the menu to show the original.

    Попробуй добавить в начало <html><head></head><body> и </body></html> в конец.
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2