www-i-p-mu
asked on
Problem to include a navigation in newsletter.
Hallo all!
Actually we've been creating a navigation which is an include function. What we would like to know is whether it is possible to use the same navigation and apply it to a newsletter mail which normaly will have the same design as our site?
Noting that we're having problems, in such a way that, we have to copy every script from the include file and paste it in our newsletter mail.
Is there any possibility to use the include function in our mail, as it will facilitate us when we will have to make future changes in our navigation.
regards
www-i-p-mu
Actually we've been creating a navigation which is an include function. What we would like to know is whether it is possible to use the same navigation and apply it to a newsletter mail which normaly will have the same design as our site?
Noting that we're having problems, in such a way that, we have to copy every script from the include file and paste it in our newsletter mail.
Is there any possibility to use the include function in our mail, as it will facilitate us when we will have to make future changes in our navigation.
regards
www-i-p-mu
You should be able to do it if you use the full URL to the includes, so it can be reached from the clients email client...
ASKER
Thx TeRReF for you reply
my problem is the newsletter email need to contain that navigation.
in the navigation.php there's some php function that are executed from by server.
i try to use fread function but i doesn't execute the php functions
is there a solution that can generate the navigation.php then send it in my email
my actual codes..
<?
$mailcontent="<table width=\"500\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>" . include('navigation.php') . "</td>
</tr>
</table>";
$headers .= "From: $admin\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($email, $subject, $mailcontent, $headers);
?>
actually the navigation is visible in browser when im creating the newsletter but it doesn't send the navigation in the letter
my problem is the newsletter email need to contain that navigation.
in the navigation.php there's some php function that are executed from by server.
i try to use fread function but i doesn't execute the php functions
is there a solution that can generate the navigation.php then send it in my email
my actual codes..
<?
$mailcontent="<table width=\"500\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>" . include('navigation.php') . "</td>
</tr>
</table>";
$headers .= "From: $admin\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($email, $subject, $mailcontent, $headers);
?>
actually the navigation is visible in browser when im creating the newsletter but it doesn't send the navigation in the letter
Try to use a return value in the include:
instead of echoing the navbar, try this:
return $navbar;
instead of echoing the navbar, try this:
return $navbar;
ASKER
can you giva me an idea how to use return value?
An example include file:
navigation.php
<?php
$html = 'navbar code goes here';
return $html;
?>
How to use it in your code:
<?
$navbar = include('navigation.php');
$mailcontent="<table width=\"500\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>" . $navbar . "</td>
</tr>
</table>";
$headers .= "From: $admin\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($email, $subject, $mailcontent, $headers);
?>
navigation.php
<?php
$html = 'navbar code goes here';
return $html;
?>
How to use it in your code:
<?
$navbar = include('navigation.php');
$mailcontent="<table width=\"500\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>" . $navbar . "</td>
</tr>
</table>";
$headers .= "From: $admin\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($email, $subject, $mailcontent, $headers);
?>
ASKER
Thx for reply,
I tried your solution but the navigation doesn't appear in the mail.
its appear only in the browser when i try to send the mail out.
regards
I tried your solution but the navigation doesn't appear in the mail.
its appear only in the browser when i try to send the mail out.
regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.