Stephan van Rooij

Software architect with a passion for home automation.

WordPress mail with Gmail

W

At some point you would like your wordpress website to be able to send email. You’ll need it for:

  • Password recovery
  • New User notifications
  • Contact forms

By putting this code in your funtions.php file off your child-theme, you won’t need a plugin to configure the gmail settings.

add_action( 'phpmailer_init', 'gmail_phpmailer_init' );
function gmail_phpmailer_init( PHPMailer $phpmailer ) {
    $phpmailer->Host = 'smtp.gmail.com';
    $phpmailer->Port = 587; 
    $phpmailer->Username = 'pietje_puk@gmail.com'; // Full username (with @gmail.com)
    $phpmailer->Password = 'your_secret_password'; // Your own password
    $phpmailer->SMTPAuth = true; // Gmail requires authentication
    $phpmailer->SMTPSecure = 'tls'; //587 is the tls port, ssl can also be configured with 'ssl' and port  is another possible value

    $phpmailer->IsSMTP();
}

Without this code you also could use a plugin for the same thing, but who needs plugins 😛

Install wordpress server site

I

You can install wordpress by using FTP, but sometimes it’s much quicker to do it server site. Basic linux knowledge is needed!. First SSH into the server.

WordPress just got even better!

W

Yesterday WordPress 4.4 was released, with this version they improved this product even more.

The most notable new features are, support for oEmbed and an integrated REST API.

What is oEmbed and why is this a new amazing feature? oEmbed is a specification for embedding content from an other website right inside the consuming website. This enables (for instance) Twitter to display the excerpt of a post instead of just a link to your wordpress website. This specification is originally design by (members of) Flicr, but with the wordpress implementation the adoption will get even bigger.

Hosting a wordpress plugin on Github

H

Someone at WordPress decided that if you want to create a plugin for WordPress, you’ll have to host it at their SVN server. Personally I’m not a big fan of SVN, I’m more a GIT person.

Lucky for me, it appears I’m not the only one. So for my latest WordPress plugin (REST API – Filter Fields) I used Github. Then I came to a few problems that had to be solved.

Like what you're seeing? Consider Sharing on Twitter or Sponsoring me