Solved

Problem to include a navigation in newsletter.

Posted on 2006-11-28
9
235 Views
Last Modified: 2013-11-18
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              
0
Comment
Question by:www-i-p-mu
  • 3
  • 3
9 Comments
 
LVL 29

Expert Comment

by:TeRReF
ID: 18026882
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...
0
 
LVL 3

Author Comment

by:www-i-p-mu
ID: 18027137
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
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 18027319
Try to use a return value in the include:
instead of echoing the navbar, try this:
return $navbar;
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 3

Author Comment

by:www-i-p-mu
ID: 18027748
can you giva me an idea how to use return value?
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 18028160
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);

?>
0
 
LVL 3

Author Comment

by:www-i-p-mu
ID: 18034045
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
0
 
LVL 3

Accepted Solution

by:
NIPPLES earned 500 total points
ID: 18041115
This could be a problem with the email CLIENT not the php!  in your navigation you use javascript?  remember different clients treat email differnt ways ofr security etc.  Some dont even enable html by default.

try and run a test such as adding a javascript alert() function to your navigation.php - im pretty sure you will never see it otherwise advertisers all over the world will be popping up alert boxes just because an outlook user passed by the email.

if on the otherhand your navigation is pure css and html it could also have problems as email clients dont always like to load external css files.

best of all try and view source for the email.

finally - imagine email clients only accept pure html and wont accept .php or .asp for fear of problems.

hope these thoughts help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Checking CSRF token within a function 36 75
tutorial for ebay api 3 35
send post values 7 26
What does $selected = $month == $beginning_month ? 'selected' : ''; mean? 5 30
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question