This is probably a very stupid question but I can't seem to find an answer anywhere. Can php code be used inside the body of a html email?
I have only every used variable names inside an email before i.e.
'<p>Dear'.$name.'</p>
But what if I want to make a table of data and use a loop? Can I put the php loop code in the email html? I have tried but it does not seem to like my syntax no matter what I try.
Just to be clear I have no problems sending the email.
{firstname},{lastname}etc... placeholders. Word REPLACES those placeholders with the recipient's actual data as part of a mail merge, then sends out the generated document. PHP does the same thing - you provided values for those variables on the server, generate the html with the values filled in, then send out the generated html.