Jump to content

is this possible?


NoDoze

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.