Failing to send emails from your 1&1 hosting?

Sending emails from your 1&1 hosting

I’ve just spent a few hours trying to get a small script to send out an emails and it not working. After many attempts and scanning the 1&1 documents, I finally by accident came across the solution.


You can send emails fine when running the script locally but after uploading the script onto server, it would fail. Reporting connection refused.


Change the email protocol fromSMTP to SendMail.

Passive Income Reality status update

It was about time I gave an update to this blog. We are now 4 months in, and I guess the big question is have I generated any passive income? Well, no, just income which was anything but passive. This site did get me a load of paid web site work, which wasn’t the point of the exercise and has taken up a lot of my time, massively constricting the amount of time I could have spent of the passive income project. On a positive note, I’m in this for the long game and I did not expect much to happen for the first 6 months or even a year, things have only been delayed a few months.

So lets take a look at PassiveIncomeReality site’s statistics. As this blog isn’t intended to generate any passive income, I’ve not aimed to attract any visitors; hence I’ve not done any SEO on the site. I carried out no real back linking other then at the start and only to alert Google to the site, insuring Google quickly indexes the pages; I have not targeted any keywords or anything else in which to try and get Google to funnel the great unwashed masses into this site.

Consequently these sites stats, which we shall look at shortly, are along the lines I expect. It won’t win any awards for visitor numbers.

First lets bring up Google Analytics, I get the following visitors graph:visitors to passiveincomereality

It’s all going in the right direction. Even with no blog updates since end of April, which is great news.

Over to Google’s web master tool, I get the following stats:

  • Google has indexed 36 pages
  • 32 links to my site
  • 11 top level domains point to the site

A lot of these links are from search engines like “more sites like”, which have nothing to do with me.

According to webmasters tools, my top 5 poplar key words are:

  1. WordPress subdomain
  2. 1&1 wordpress
  3. javascript notes
  4. 1&1 web hosting
  5. Customizing wordpress

Alexa gives the site a rank of: 2,339,138

Google PageRank still has not ranked this site.

It’s a shame I never tried to track any keyword rankings for the site, it would have been interesting to see how they changed overtime. Basically this was because I did not do any keyword research and hence no target keywords to rank for, so I never ran any checks. I should have monitored some phases out of interest.

Using Rank Checker, lets check some phrases with Google, some are taken from blog post titles, others are just random-ish guesses. As of the 6th July I get the following:

  • Passive income reality – 3
  • How to setup wordpress on 1&1 – 7
  •  How to setup wordpress – 20
  • WordPress – not found
  • How to costomize wordpress – 40
  • WordPress fsp – 56
  • Passive income – 114

I’ll check these again when I do another statistics blog post in the future.

Interestingly as I’ve been very busy with other projects, I’ve not updated this site for 2 months; the last blog entry was 30th April, and since then the only event of any consequence has been finally getting my adsense account activated by google, more on this interesting up hill struggle at the end of this post.

web master tools search query

The above graph shows something possibly interesting. It “clearly” shows over time, the number of impressions google does of my site have been constant for weeks leading up to the 20th June when my AdSense account was approved. Then a few days later there is an obvious upward tend which then dropped to the previous peak, before rising to double the impressions then before AdSense was added. As nothing apart from AdSense had changed, it points to a positive effect on getting ranked higher in google for some keywords. This of course could just be a coincidence.

Other news is that I have a new site almost ready to launch, I had completed all the code and layout a few weeks back, the delay on getting it live is I need to write all the fluff for it, like terms and conditions, some blurb on what the site does, how to use it..etc This new site isn’t aimed directly at passive income either, it was more of a way of testing out JQuery, PHP and JavaScript.  If, as I hope it does get used by people, it will hopefully get linked too a lot as well and generate PageRank from which I can direct at other sites which I plan to have to generate passive income from. From doing this site I can highly recommend JQueryUI. It makes knocking up great looking, interactive web sites very quick and simple.

My google AdSense fun

I had some problems getting Google Adsense working on this site. It wasn’t a problem with the technical side, it was trying to getting this site reviewed by Google, so they would approve my AdSense account. My issue was that I tried to add AdSense many years ago to a blogger site I had. I applied too early and thus it contained too little content, so it was rejected. I had forgotten about this. Unfortunately even though I added passiveincomereality to this account, they kept only checking my old blogger site, and rejecting my application. I even deleted the blogger account and removed it from the AdSense, but when it come to approving the account, Google would keep looking for this blogger site and telling me, it could not be found. There is no way to tell Google to look at another site!

In the end I only way of adding AdSense to this web page was to create a new google account and apply with that. As you can this was successful. Not that I’m expecting any clicks on here and hence any income from this site, it was more about getting the account approved, so when I want to add it to another site I wish to generate passive income from in the future, I’m good to go.

PHP Notes

As I’m jumping from JavaScript to PHP and back at the moment, I’ve decided to maintain some reference pages which I can refer too, so I have only one place I need to look for when I want to be reminded how you do a string length in PHP after working in Javascript for a few hours.

String Length
$length = strlen(str);

$str = 'abcdef';
echo strlen($str); //6

Redirect a web page to another web page
header(“location:” + url);


Complex syntax
This is using curly brackets around variables so PHP knows when they end. Useful for generating generating more complex strings. It only works when a $ immediately follows the opening bracket.

$lunchtime = "12:30";

echo "<p>time is $lunchtime</p>";
outputs >> time is 12:30
// now lets add pm to get 12:00pm
echo "<p>time is $lunchtimepm</p>";
//wrong, can't fine the variable.
outputs >> time is
//Useing Complex syntax
echo "<p>time is {$lunchtime}pm</p>";
outputs >>time is 12:30pm

Variable variables
This one is new to me, looks really useful. You can assign a string to a variable, then use that variable to index a variable with that string name. The syntax is an extra $ to signify use the assigned value as the variable to use.

//create a variable called $second and set it to 2
$myvar = "second";
$$myvar = "2"; //use the assigned string as the variable name: "second"
echo "$second = ${$myvar}";
outputs >> 2 = 2

//another example
$fluffy = "fish";
$puss = "milk";

$petCat = "fluffy";
echo "$petCat loves ${$petCat}";
outputs >> fluffy loves fish
$petCat = "puss";
echo "$petCat loves ${$petCat}";
outputs >> puss Loves milk

Remove a variable or item from an array
Use unset($varname), unset($var1,$var2,etc…)

unset($var1); //var1 is deleted
unset($arr[0]); // the first item in the array $arr is deleted 

define(“constant name”,”constant value”);
Constants can be upper case/lower case or a mixture of both. It’s generally seen correct to use all uppercase. Constants don’t have the $ in front of them like variables do.

define("MYCONSTANT","Some constant thing");
outputs >> Some constant thing

JavaScript Notes

As I’m jumping from JavaScript to PHP and back at the moment, I’ve decided to maintain some reference pages which I can refer too, so I have only one place I need to look for when I want to be reminded how you do a string length in PHP after working in Javascript for a few hours.

== is general comparison, using conversions to get a match. i.e. number 1 is equal to the character 1.
=== is exactly the same, i.e. number 1 is not equal to the character 1.

if x=1, below shows the various comparisons at work:

x==1    >> true
x=="1"  >> true

x===1   >> true
x==="1" >> false

x!=2 >> true
x!=1 >> false
x!="1" >> false

x!==2 >> true
x!=="1" >> true
x!==1  >>false

String Length

Getting the length of a string.
var length = string.length();

var str = 'abcdef';
alert(str.length()); //6

Redirect to another web page

//another page in the same directory
//another page in a parent directory
//another page with with a non relative directory

Intro to SEO – Search engine optimisation

SEO site trafficWhat is SEO?

SEO stands for Search Engine Optimisation. This post will cover some basics of what is called ‘on page SEO'; this is search engine optimisation which takes place on your web pages, as a posed to tasks you can do away from you own site, such as back linking.

On page SEO is an important task which takes advantage of how search engines work. Search engines see your site not as a collection of well crafted pages as normal people do, but a load of pages full of keywords and phrases. When search engine users query a search engine, on a basic level it will break up their search term into keywords and match up the search keywords to its keyword list and return the pages with the most relevant keywords.
Continue reading

How to restore your WordPress database

Restoring your databaseIf the very worse happens and your WordPress site stops working and you can’t sign in, to work out what has gone wrong, it’s lightly you will need to restore your database from a backup and possibly even your web site’s file. If you followed the post on how to backup your database, this post will show you how you can restore it back, and recover your site.
Continue reading

How to use a sub domains in WordPress

What is a sub domain?

If we take a web address like, it is basically a hierarchy.

  1. com – Level 1 or top of your domain hierarchy.
  2. passiveincomereality – Level 2 is your domain.
  3. wordpress – Level 3, this is what is called a sub domain. These are optional, by default all websites have WWW setup, but this can be left off the web address on your browser and it will still find the root domain.

A sub domain is any element of a URL or domain which is level 3 or greater in the hierarchy, they are used to divide large websites into sections. An alternative method used to achieve this is to use directories, WordPress uses this structure with its wp-admin directory for admin access. Unfortunately I don’t know of a way to get WordPress to configure your site into a way which this can be utilised, well not with out some effort. But essentially how most non-Wordpress sites are setup is that a sub domain will point to a directory off the main site.

The other main benefit of sub domains are that they can be used with your web email. For example if your site was setup with a sales and support sub domain you could then have, as well as, with each with its own email box. Useful no?

How to create a sub domain?
Continue reading

How to attract visitors to your site

First steps in getting traffic to your siteSadly the World Wide Web does not conform to the saying ‘If you build it, he will come’. You can spend months or years creating great content for your blog or web site and not get a single visitor. In this post we will cover some basics which need to be done so you can start your journey down the road to getting traffic.

How alert the search engines to your site

The first thing any site should do is to let the search engines know about your site. Once a search engine knows about your site, it will scan each page to work out what it is about, the term for this is that they crawl over your site with a web crawler.
Continue reading

How to track the web site traffic on your site

Installing web analytics on your WordPress site.Getting information on you web site’s users is key to turning your blog or website into a passive income stream. Knowing where they are coming from, what they do when they visit your site, how long they stay for are key data points you should track to you can fine tune your site; the term used for this is Web analytics. Wordpress doesn’t have any functionality build in to tracking users, at least not by default. Luckily there is a plethora of web analytic services out there, both free and paid, which you can use to get all the data you are looking for.
Continue reading

WordPress Plugins

What is a WordPress Plugin

WordPress Plugins are created then sold or given away for free by other WordPress users, they enhance the functionality and features of WordPress sites. With out fail, every WordPress site will have plugins of some kind, some even come pre-installed with WordPress.

How to find WordPress Plugins

There are a few different ways to find and install WordPress plugins.

The simplest way is to use the WordPress Admin dashboard, infact it’s very similar to looking for a new WordPress theme. From your main WordPress admin page, on the left menu select Appearance/Plugins/Add New.

You will see the Install Plugins page. From here you can search a huge list of plugins using ‘Search Plugins’.

Finding a wordpress plugin to install
Continue reading