Note that there are some explanatory texts on larger screens.

plurals
  1. POload html mail file inside php
    primarykey
    data
    text
    <p>I implemented a html email inside a html file. And i have a php file which uses the <code>PHPMailer</code> class to send emails. What i want to achieve is, i have some text inside the html that should change depends who i send the email.</p> <p>This is the php file that sends the emails</p> <pre><code>&lt;?php // get variables $contact_name = addslashes($_GET['contact_name']); $contact_phone = addslashes($_GET['contact_phone']); $contact_email = addslashes($_GET['contact_email']); $contact_message = addslashes($_GET['contact_message']); // send mail require("class.phpmailer.php"); $mailer = new PHPMailer(); $mailer-&gt;IsSMTP(); $mailer-&gt;Host = 'ssl://smtp.gmail.com:465'; $mailer-&gt;SMTPAuth = TRUE; $mailer-&gt;Username = 'danyel.p@gmail.com'; $mailer-&gt;Password = 'mypass'; $mailer-&gt;From = 'contact_email'; $mailer-&gt;FromName = 'PS Contact'; $mailer-&gt;Subject = $contact_name; $mailer-&gt;AddAddress('pdaniel@gmail.com'); $mailer-&gt;Body = $contact_message; if($mailer-&gt;Send()) echo 'ok'; ?&gt; </code></pre> <p>And the html file containing a simple html mail implemented with tables and all that standard it need.</p> <p>I want to ask braver minds than mine which is the best approach to accomplish this. :)</p> <p>Thank you in advance, Daniel!</p> <p>EDIT: right now, in the $mailer->Body i have the $contact_message variable as a text email.. but i want in that body to load an html file containing an html email and i want to somehow change the body of the html email with the text inside this $contact_message variable.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload