PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 7, 2022

[FIXED] how to send email template html page?

 July 07, 2022     phpmailer     No comments   

Issue

Im using PHPMAILER 5.2.7 !

  $to=$row['email'];
  $at=$row['updated_at'];
  $subject = "Your Password has been changed";
  $body = "<body background='red' style='bgcolore:red;'><p>Hello < ".$u." > your password has been 
  changed at ".$at." ! </p>";
  $SITEEMAIL='support@test.tn';
  $mail = new Mail();
  $mail->setFrom($SITEEMAIL);
  $mail->addAddress($to);
  $mail->subject($subject);
  $mail->body($body);
  $mail->send();

how can i switch the $body content with a html page (template) ?? tried to directly past the code inside $body but i dosen't work !


Solution

I see several strange things in your $body text, try using more simple contents from this sample first. github.com/PHPMailer/PHPMailer#a-simple-example

In any case, you should also call $mail->isHTML(true); before sending.



Answered By - user14967413
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing