Configuring WordPress to send email using Gmail on Debian

May 26, 2009 by Mark  
Filed under Linux, Tips & Tricks

1. Install ssmtp using the following command.

apt-get install ssmtp

2. Edit ssmtp.conf

nano /etc/ssmtp/ssmtp.conf

Now update or add the following configuration to the ssmtp.conf

mailhub=smtp.gmail.com:587
AuthUser=user@gmail.com
AuthPass=YourGmailPassword
FromLineOverride=YES
UseSTARTTLS=YES

You should replace user@gmail.com with your gmail email address.

3. Now you can test the ssmtp if its work or not by typing the following command in the terminal.

echo “Hello World!” | mail –s “Hello” user@domain.com

Please change user@domain.com with your email address.

Within a few second you will receive the email message. If its doesn’t works please check your ssmtp.conf.

4. Finally its time to set your wordpress installation to use sendmail instead of mail().

Open pluggable.php (located at wp-includes) with your favorite text editor.

Find the following text.

// Set to use PHP mail()
$phpmailer -> IsMail();

Replace $phpmailer -> IsMail(); with :

$phpmailer -> IsSendmail();

Now your wordpress blog will be able to send email with your gmail email account.

Comments

One Response to “Configuring WordPress to send email using Gmail on Debian”
  1. Daniel says:

    nice & easy, working great. thank you!

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!