0

I have to send a html in mail with jquery tooltip. The html is working fine but the jquery tooltip doesn't show up with the HTML. my code is

require_once("config.php");

$to= "[email protected]";
$subject= "Todays follow up status from Murree Hotels Website";

$query= "select * from honymoon_enquries WHERE arrival_date BETWEEN DATE(NOW()) AND DATE(NOW())+7 order by arrival_date";

$res=mysql_query($query);

$message = "<strong>Hi Admin <br><br> </strong>";

$message .= "<strong> Here is the list of all clients coming in next seven(7) days.<br><br> </strong>";

$message .="
<link rel='stylesheet' href='jquery-tooltip/jquery.tooltip.css'/>
<script src='jquery-tooltip/lib/jquery.js' type='text/javascript'></script>
<script src='jquery-tooltip/lib/jquery.bgiframe.js' type='text/javascript'></script>
<script src='jquery-tooltip/lib/jquery.dimensions.js' type='text/javascript'></script>
<script src='jquery-tooltip/jquery.tooltip.js' type='text/javascript'></script>

<script src='jquery-tooltip/demo/chili-1.7.pack.js' type='text/javascript'></script>

<script type='text/javascript'>
$(function() {
$('#right *').tooltip({ 
    track: true,
    delay: 100,
    showURL: false,
    extraClass: 'right'
});

$('#right2 a').tooltip({ showURL: false, positionLeft: true });

$('#block').click($.tooltip.block);

});
</script>
<table width='100%' cellpadding='0' cellspacing='0' style='margin-top:5px;margin-bottom:5px;'> 
    <tr> 
    <td> 
        <div style='border:1px solid #CCCCCC; padding:10px; padding-top:5px; text-align:center'> 
<div>           
<table width='100%' border='1' cellpadding='5' cellspacing='3'>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Arival_Date</th>
<th>Adminfeedback</th>
</tr>
";      
while ($resresult = mysql_fetch_array($res)) {

$message .="
<tr BGCOLOR='99CCFF'>
<td>".$resresult['client_name']."</td>
<td>".$resresult['client_email']."</td>
<td>".$resresult['client_phone']."</td>
<td>".$resresult['arrival_date']."</td>
<td align='left' title='".$resresult['adminfeedback']."' style='cursor:help;'>".$resresult['adminfeedback']."</td>
";      
}
$message .="</table></div></td> </tr> </table></div>" ;


$headers = "From: [email protected]"."\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


if (!mail($to,$subject,$message,$headers)) {
   die("Message sending failed");
}
5
  • 2
    your want a javascript tooltip in the email? short answer - you can't. big security issue if email clients allowed js, so they don't. Commented Jun 10, 2011 at 4:55
  • no can do. javascript in an email is a no go. Commented Jun 10, 2011 at 4:57
  • He can, email can contain HTML and JavaScript Commented Jun 10, 2011 at 4:58
  • try to set your message with html tags, and you didn't include the jquery lib in the message, try doing this changes Commented Jun 10, 2011 at 4:58
  • @Dani care to show proof of JS inclusion? Commented Jun 10, 2011 at 5:00

3 Answers 3

1

The short answer is you can't. Mail clients strip out JS. It's next to impossible to include an external stylesheet in some clients let alone JS

Sign up to request clarification or add additional context in comments.

2 Comments

hi so we dont send jquey in mail fuction?:))
@shoaibakhunzada yup. You don't send it. You should read this article on good guidelines for HTML emails : campaignmonitor.com/design-guidelines
1

Email clients generally strip out or don't process JavaScript and for good reason.

Just stick with plain HTML and the subset of CSS that works over majority of mail clients.

Comments

1

Email clients will not parse/execute JavaScript. If they did, it would lead to all kinds of unpleasant security issues. What you are trying to achieve is not possible my friend.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.