NoDoze Posted July 16, 2010 Share Posted July 16, 2010 $msg = "".include 'emailtemp1.php?val=$var&val2=$var2'.""; Any options or ideas on how to make it work? Thanks! Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 16, 2010 Share Posted July 16, 2010 Could you explain what you're trying to do? Quote Link to comment Share on other sites More sharing options...
NoDoze Posted July 16, 2010 Author Share Posted July 16, 2010 heh....LOL The $msg variable is for a php email. The $msg is a complex html email pulled together with data using php and mysql. I know normally it would look like this: $msg = '<html>'.<php>.'<ect>'; But to go through the ENTIRE page putting '. and changing ' or "...it would be much easier to just include the email template... Hence the $msg = include='page.php'; Does that clarify some? LOL Possible? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 16, 2010 Share Posted July 16, 2010 You can have the email template in another file and use file_get_contents, $msg = file_get_contents('emailtemplate.php'); Alternatively define the template within HEREDOC syntax, $msg = EMAIL_TMP your email template here EMAIL_TMP; Heredoc can contain variables and you do not need to worry about escaping ' or " Quote Link to comment Share on other sites More sharing options...
NoDoze Posted July 16, 2010 Author Share Posted July 16, 2010 oh wow! I forgot all about the HEREDOC... and didn't even know about the file_get_contents! Thanks! Quote Link to comment Share on other sites More sharing options...
NoDoze Posted July 16, 2010 Author Share Posted July 16, 2010 Second question.... What would be an alternative to sending an HTML email? Not everyone accepts HTML emails... Is there a way I can generate the php page to a text file, then email the contents of the text file? The data in the email is generated using php and mysql...its info from a database. How would I send this via email? Thanks! Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 16, 2010 Share Posted July 16, 2010 You can send it multipart, text and html. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.