Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Include the text of a remote file in your emails
12-30-2010, 06:17 PM
Post: #1
Include the text of a remote file in your emails
Using PHP and scripting within Mach5 Mailer Gold, you can include the contents of a remote file in your outgoing emails. If you're using PHP for scripting there are a few settings you must change before you can procede.

1) You must have PHP5 installed before continuing. PHP5 can be downloaded, for free, from http://www.php.net/downloads.php Use the 'PHP Installer' in the 'Windows Binaries' section.
2) Once PHP is installed you must enable allow_url_fopen in your php.ini file by setting it to 'On'.
3) Tell Mailer where PHP5 is installed.
  Open Mach5 Mailer. In the top menu, click 'Mail'->'Program Options'. Select the 'Mail Options' tab.
  Under 'PHP Settings' click 'Browse' and locate the PHP installation folder (usually C:\PHP). Click 'OK', then 'OK' again.
4) Enable PHP as the scripting language in Mach5 Mailer Gold
  In the top menu, click 'Mail'->'Mail Merge Information'. Select the 'General' tab and set the scripting language to 'PHPScript'. Click 'OK'.
5) You're ready to use PHP scripting in your emails.

Open your mailing in Mach5 Mailer. In the Editing Pane, (either the Plain(text) or HTML pane) enter the following code to include the text of a file on your webserver in your email.

<?php //tell Mailer that php code is going to be used
// get contents of a file into a string
$filename = "http://www.myserver.com/file.txt"; //the location and name of the file on your server. replace the test link with your own.
$contents = file_get_contents($filename); //read the contents of the file into the $contents string variable
echo $contents; //output the file to your email page
//tell Mailer the php code has ended
?>

You can easily test the following code by clicking the "Preview' tab at the bottom of the Mach5 Mailer window. Its to the right of 'Plain' and "HTML'.

You'll see a preview of both your Plain (aka. Text only) and HTML emails. These are selected, again, by tabs. You can click through your database and check that each email is generated correctly

From the Preview tab, you can even send a test message to any email address you like. Simply click the 'Send this Message' button in the bottom-right of the preview window.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-11-2018, 09:31 AM
Post: #2
study post
Thanks for the heads up here. I will inform mac users working at www.rushessaysbest.com who might get help with this. Thanks for sharing with us
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Plain text margins are too narrow mlandis 3 4,568 05-12-2018 08:23 AM
Last Post: pollard45p

Forum Jump: