Technology Blog

Widgets

Sending mail in PHP - avoid sending to junk folder

We all know that PHP is great for back-end development. However, some functions can be tricky to fine tune for the best web development possible. The mail() function has a high probability of sending mail to user’s “junk” or spam folders because the connection was not authenticated. To avoid that, use the following function below. This assumes you have PEAR setup and working properly.

  1.  
  2. <?php
  3.  require_once "Mail.php";
  4.  
  5.  $from = "Sandra Sender <sender@example.com>";  $to = "Ramona Recipient <recipient@example.com>";  $subject = "Hi!";  $body = "Hi,\n\nHow are you?";
  6.  
  7.  $host = "mail.example.com";
  8.  $username = "smtp_username";
  9.  $password = "smtp_password";
  10.  
  11.  $headers = array (‘From’ => $from,
  12.    ‘To’ => $to,
  13.    ‘Subject’ => $subject);
  14.  $smtp = Mail::factory(’smtp’,
  15.    array (‘host’ => $host,
  16.      ‘auth’ => true,
  17.      ‘username’ => $username,
  18.      ‘password’ => $password));
  19.  
  20.  $mail = $smtp->send($to, $headers, $body);
  21.  
  22.  if (PEAR::isError($mail)) {
  23.    echo("<p>" . $mail->getMessage() . "</p>");
  24.   } else {
  25.    echo("<p>Message successfully sent!</p>");
  26.   }
  27.  ?>
  28.  
  29.  

jQuery slideUp stops working in 1.3.2

After testing across a couple browsers and having some of them work. I figured there must be a bug in jquery. Turns out I was correct. Here’s the quick fix. Please make sure to backup your .js files before making any changes to them. Use these updates at your own risk. I will post the related jquery references at the end of this post. Make sure to check which version of jquery you’re using first. Generally, there is the normal version and min version. I do not have the fix for the compact version listed.

For the “normal” version:

Find the code:
return elem.offsetWidth === 0 || elem.offsetHeight === 0

Change to:
return elem.offsetWidth === 0 && elem.offsetHeight === 0

For the “min” version:

Find the code:
return T.offsetWidth===0||T.offsetHeight===0

Change to:
return T.offsetWidth===0&&T.offsetHeight===0

This is the ticket regarding the issue:
http://dev.jquery.com/ticket/4374

And here’s the fix for it:
http://dev.jquery.com/changeset/6282

That’s it!

What is Social Media?

I attended a conference yesterday where one of the topics was, “What is Social Media?”. I have to mention up front that all the audience members were business owners or representing their business. There was a panel of 4 “experts” that, quite honestly, didn’t do the topic justice. They completely left out the most important part of social media when running a business. We will get to that in a little bit.

Their first question to the audience was to define social media. I thought this was an excellent way to open the segment. And, people in the audience rambled off all the buzzwords: Facebook, Twitter, YouTube, MySpace, and the rest. The second question was to define the use of social media. Almost the entire audience thought social media was nothing more than a “networking” tool!

Even worse, more people in the audience are networking via LinkedIn rather than Facebook. With 435 million subscribers on Facebook and only 65 million on LinkedIn…well, you do the math. One might argue that LinkedIn is more “professional” than Facebook. This might be a valid argument, but we still didn’t get to the 1 and only point to social media for business.

Ok, I won’t keep you waiting any longer. The ONLY reason you should be leveraging Social Media in your business plan is to drive traffic to your website! Period. You can have a thousand friends following you on Twitter, but if you’re not directing them to useful information on your website, it’s all pointless. All the social media outlets should be used and treated like the rest of your marketing material. Actually, this is the new way to market. Print media has been dead for a while. TV ads are great for Coke and Pepsi, but most companies can’t compete at that level.

It doesn’t matter where the traffic is coming from. As long as your name is out there. The larger the reach, the more traffic you drive to your website. Simple, right? LinkedIn isn’t even in the top 20 when it comes to site ranking. For site ranking, check out Alexa.

Once you leverage social media to drive traffic to your website with useful content, you will gain Page Rank on your website. Gaining page rank on your website means better results in Google, Yahoo, and Bing. Bottom line is that Social Media is a powerful tool to increase your SEO efforts by driving traffic to your website. That’s it!

If you would like to setup a proactive plan to increase traffic to your website through proper Search Engine Optimization, please click on contact and reach out. There is no obligation and the benefit could easily double your leads and call volume when done correctly.

noindex and nofollow explained

There are a lot of people who throw around these search engine optimization terms as if they know what they’re talking about. I’m going to try and break it down in layman’s terms so that you can talk intelligently about them to others.

Also, you might have heard people mention “dofollow’ links. I just want to make you aware that no such link exists in the source code. It is only a term to describe the opposite of a “nofollow” link. Ok, let’s get started…

I’m sure you’re more than aware that “robots” crawl websites. This is how the big dogs such as Google, Yahoo!, and Bing store or index your page in their database servers. There are a lot of other crawlers or spiders out there doing the same thing. They all act a little differently. Just know that “indexing” a page is nothing more than the search engine company adding it to their database.

The “nofollow” tag is used to disallow the page rank of linking site to affect your site. If you’re just getting your site off the ground, you probably wouldn’t want to “nofollow” any links in hopes to gain the page rank (PR) of the link. The robots don’t crawl what we humans see in the browser, but rather the source code behind the scenes. If you ever want to look at the “source” of a website, just right-click on the page and choose “view source code”.

Once you get into the source code, you will see a lot of stuff going on in there. For this topic, we are only concerned with the stuff between the “head” tags or on an anchor tag. Let’s start with the “head” tag.

In the “head” tag, you can apply the “noindex” and “nofollow” tag to the entire page like so:

  1. <meta name="robot" content="noindex,nofollow">

Doing this at the page level of your site is very dangerous to YOUR page. Once Google gets a “noindex” directive on a page/link, it will remove it from their servers. If you have a custom footer with links to your site, you are hurting all YOUR links! On the flip side, if you have a family photo album or private landing pages, this is a great idea to keep them private. Again, make sure you don’t have any links on the page that you WANT to be indexed. The “nofollow” attribute will not give any rank back to all the links on the page.

The other way to apply these attributes is in the link like so:

  1. <a href="http://www.example.com/" rel="nofollow">anchor text</a>

Just know that the “noindex” link can only be applied in the meta tag like in the first example. This second example is showing how to protect your page by not allow the specific link(s) to affect your rank. If you don’t use the “nofollow” attribute on links or pages, you will be passing your valuable rank to them. If they don’t reciprocate a link back to you, I would “nofollow” all links. Most blog sites will apply the “nofollow” attribute to all their comments.

Hope this helps in your quest to climb the ranks of SEO!

Avaya IP Office 4.2 Direct Voicemail Transfer

Most clients want a “transfer to voicmail” button. I don’t know why Avaya doesn’t just make this a simple feature. Regardless, I could not get this to work. I’ve done it a 100 times, but still no luck. It seems that there might be something wrong with 4.2 and specifically build 4. More than likely, your IP Office 406v2 already has build 5 ready to upgrade. You can check by:

File -> advanced -> upgrade

You will see any available builds. BUT WAIT: before you do the upgrade, make sure your phones are prepared for the firmware upgrade. Your phones, in my case usually a 5410, will get it’s directive from the NoUser profile. Simply go in this profile and add a new source number:

ALLOW_5410_UPGRADES

Now you can go back to the system upgrade in the first step above. After that is complete, you can add the short code:

Code: #XXX
Feature: Voicemail Collect
Tel Number: “#”N

That should do it.

© ZADRO Solutions, Inc. All Rights Reserved. Disclaimer | Privacy Policy
RSS Facebook Digg Delicious Stumble Upon Twitter