410-696-4690

E-mail Us

Posts Tagged ‘gmail’

Automate Your Gmail Backups

Wednesday, August 13th, 2008

Yesterday Gmail was down for a short period of time though to some it was an eternity. We recommend Google Apps (with Gmail) to a lot of clients due to the incredible reliability, unbeatable price (free for most purposes) and normally near 100% up-time.  Due to the mayhem that ensued across the blogosphere we decided to run some internal backups so we have a fallback in case Gmail ever explodes or disappears suddenly, which would probably have more adverse affects on the economy than on our petty email threads.

If you use Gmail for your primary email provider I would suggest scheduling your own backup if you do not already do so. Lifehacker.com has a great tutorial to get you started on a Windows machine as well as a Linux-based machine (you can just follow the command line steps to configure and run fetchmail). Better safe than sorry.

As an aside - does anyone know of a PHP-based script that can accomplish this same task? Being a Web developer it would be great to run this from our Web server without installing Cygwin.

Sending E-mail on GoDaddy

Wednesday, December 19th, 2007

While GoDaddy is a great hosting server (reliable, flexible and secure from what I’ve experienced) they have always been a bit tight with what features are enabled on their servers. I can’t blame them - I’ve experienced two hacked shared servers (non-GoDaddy) in the past two years due to a security exploit that went unnoticed. The one issue I consistently have is sending email from a Web site, most commonly for a contact form. In this post I will go over configuring a module named PHPMailer in order to accomplish sending an e-mail from GoDaddy’s servers.PHP Who?
PHPMailer is an open-source component from CodeWorxTech that is one of the easiest pieces of code I’ve used in a long time. Configuration is short and simple and they provide plenty of documentation on using it. Just searching “PHPMailer” on Google is like an entire API resource due to it’s widespread use.

Setup
I won’t go over how to setup PHPMailer since there is enough out there to get you started. This post is more about configuring it to work with GoDaddy. If you want to know how to install it and include it in your project, look here: http://phpmailer.codeworxtech.com/tutorial.html#2.

GoDaddy’s Relay Host

While GoDaddy has disabled the mail() command for security reasons, they do allow you to connect to their SMTP relay server to send emails. In this configuration it is a very minimal modification as simple as specifying the correct host. Unfortunately it took me 5 hours to find this information before I knew it existed. Here is the code:

// This code assumes you have already include class.phpmailer.php in your project.
// Instantiate new PHPMailer
$mail = new PHPMailer();
// Configuration
$mail->Host = “relay-hosting.secureserver.net”; // GoDaddy’s relay server
$mail->From = “name@your-domain.com”;
$mail->FromName = “John Doe”;
$mail->Subject = “Sample Email From GoDaddy”;
$mail->Body = “Hello, World!”;
$mail->AddAddress(”recipient-email@their-domain.com”, “Recipient Name”);
if (!$mail->Send()) {
$err = “Oops, couldn’t send the email: ” . $mail->ErrorInfo;
} else {
// Email sent successfully
}

Pretty simple, huh? You don’t even need to send your email login information which is good if you are sharing the file with a lot of subcontractors and don’t want to give them access to your account information.