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! Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/ 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? Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/#findComment-1087255 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? Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/#findComment-1087256 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 " Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/#findComment-1087261 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! Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/#findComment-1087263 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! Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/#findComment-1087274 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. Link to comment https://forums.phpfreaks.com/topic/207985-is-this-possible/#findComment-1087277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.