Friday, March 15, 2013

VMPlayer The File is To Large


I recently bought a Buffalo LinkStation NAS drive to be used on my LAN. The idea being that all shared files to go there as also the VMs (I need lots of them for the work that I do!).
Installed the NAS drive, created shared areas, configured a DLNA server etc etc. All went fine. Now the moment of truth – would I be able to successfully run VMs that reside on NAS?
Setup was as follows:
  • Windows 7 Prof
  • VMWare Player 7.0.1
  • Buffalo LinkStation NAS
  • All connected through LAN
  • Launched one of the VMs by double clicking the .vmx file. All fine so far, VM Player kicks in and starts to load, but then the following error was thrown:
  • Here’s how to fix it:
  • Edit your .vmx file with your favorite text editor
  • Add a line to the end of this file:
  • diskLib.sparseMaxFileSizeCheck="FALSE"
  • Now fire up the VM again and hopefully it should work as normal!

    Donot forget to give your comments /suggestions and refer to your friends.

Monday, March 11, 2013

Sending SMTP mail to gmail using PHP

Sending mail from your web server is a very common thing that many of us need to do. To do this, the most common approach is to use the following PHP code:mail($to, $subject, $message, $headers);

      This method sends a copy of the email, directly to the recipients mail server from the web server. However generally speaking, the web server is not the real mail server for the domain you’re trying to send from which can cause major issues.For example, lets say I have a website at www.myweb.com and when someone registers it sends them an email from the address website@myweb.com. The recipients mail servers spam filtering facility may do an MX lookup on the myweb.com domain and notice that the real mail server for the myweb.com has a different IP address to the address where the email is originating from (the web servers IP address). For this reason web server emails are often flagged as spam and thus never received by the intended recipient.To avoid this, we can relay the mail through the domains real mail server using SMTP. Using this method the mail will come to the recipients mail server from the real mail server for the senders domain as seen in its MX records. This then avoids the problematic spam filter rule.To achieve this I use the Mail.php class as found in the PEAR::Mail library located at http://pear.php.net/package/Mail. If you’re using CentOS like me, you can easily install this package using the following 

command#yum install php-pear-Mail

In this example I’m connecting to a gmail server which requires the connection to be over SSL: 

<?php 

require_once('Mail.php');

$host = 'ssl://smtp.gmail.com';

$port = '465';

$username = '<your email address>';

$password = '<yourPassword>';

$subject = 'my subject';

$to = '<to email address>';

$from = $username;$message = 'test';

$headers = array ('From' => $from,'To' => $to,'Subject' =>subject);

$smtp = Mail::factory('smtp',

array ('host' => $host,'port' =>; $port,'auth' => true,'username' => $username,'password' => $password));

$mail = $smtp->send($to, $headers, $message);

if (PEAR::isError($mail)) {

  echo("<p>" . $mail->getMessage() . "</p>");

} else {

  echo("<p>Message successfully sent!</p>");

}

?>

If SSL wasn’t required I’d just need to remove the ‘ssl://’ from in front of the host declaration and change the port to 25 like this:

$host = 'mail.myweb.com';

$port = '25';

Obviously you’ll need to ensure that your firewall allows your web server to make connections to your smtp host over port 25 or 465 for SSL.


Donot forget to give your comments /suggestions and refer to your friends.