خرید بک لینک
After many hours I finally have the email system working on my website, but now I want to give the emails I send to my customers a layout using html. Now, of course I've found multiple guides online in which I'm told to type the html inside of the php file in the following way:

Code:

EXAMPLE (https://css-tricks.com/sending-nice-html-email-with-php/)
$message = '<html><body>';
$message .= '<img src="//css-tricks.com/examples/WebsiteChangeRequestForm/images/wcrf-header.png" alt="Website Change Request" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($_POST['req-name']) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" . strip_tags($_POST['req-email']) . "</td></tr>";
$message .= "<tr><td><strong>Type of Change:</strong> </td><td>" . strip_tags($_POST['typeOfChange']) . "</td></tr>";
$message .= "<tr><td><strong>Urgency:</strong> </td><td>" . strip_tags($_POST['urgency']) . "</td></tr>";
$message .= "<tr><td><strong>URL To Change (main):</strong> </td><td>" . $_POST['URL-main'] . "</td></tr>";
$addURLS = $_POST['addURLS'];

However, to me this doesn't look like a very convenient way to setup and test te html code. So I was wondering if it is possible to write the html code in a separate php file and then in the email-php file use, for example: $message = incude($email_message.php).
I've tried it myself, but didn't get it to work. I might have don something wrong.
Thnak you advance.

برچسب: نویسنده: آیلین رضوانی تاريخ: جمعه 15 دی 1396 ساعت: 16:52

صفحه بندی