Gmail As The SMTP Service

Wikidot software sends email on various occasions: when people create new accounts, recover lost passwords, invite their friends etc.

When a local SMTP (or Sendmail) service cannot be used, an external SMTP could work. It is sufficient to edit the GlobalProperties.php. The code below will instruct Wikidot to use smtp.gmail.com as a default email service:

GlobalProperties.php:

<?php
/* this block defines how to connect to the SMTP server */
public static $DEFAULT_SMTP_HOST='smtp.gmail.com';
public static $DEFAULT_SMTP_PORT=465;
public static $DEFAULT_SMTP_USER='your-user@gmail.com';
public static $DEFAULT_SMTP_PASSWORD='your-password';
public static $DEFAULT_SMTP_SECURE='ssl';
public static $DEFAULT_SMTP_AUTH = true;
 
/* this block defines headers in the email */
public static $DEFAULT_SMTP_HOSTNAME='smtp.gmail.com';
public static $DEFAULT_SMTP_FROM_EMAIL="your-user@gmail.com";
public static $DEFAULT_SMTP_FROM_NAME="Your Wikidot Bot";
public static $DEFAULT_SMTP_REPLY_TO="your-user@gmail.com";
public static $DEFAULT_SMTP_SENDER="your-user@gmail.com";
?>

If you are using Google Applications for Domains (e.g. you have wikis in *.example.com domain and example.com is also handled by Google) you have even more flexibility:

<?php
/* this block defines how to connect to the SMTP server */
public static $DEFAULT_SMTP_HOST='smtp.gmail.com';
public static $DEFAULT_SMTP_PORT=465;
public static $DEFAULT_SMTP_USER='your-user@example.com';
public static $DEFAULT_SMTP_PASSWORD='your-password';
public static $DEFAULT_SMTP_SECURE='ssl';
public static $DEFAULT_SMTP_AUTH = true;
 
/* this block defines headers in the email */
public static $DEFAULT_SMTP_HOSTNAME='smtp.example.com';
public static $DEFAULT_SMTP_FROM_EMAIL="automailer@example.com";
public static $DEFAULT_SMTP_FROM_NAME="Wikidot Mailer";
public static $DEFAULT_SMTP_REPLY_TO="no-reply@example.com";
public static $DEFAULT_SMTP_SENDER="automailer@example.com";
?>

The two above configurations use SSL to connect to Google servers and should work without any tweaks. Just adjust user name(s), password and domain.

Comments

Giovanni SavastanoGiovanni Savastano 1212337781|%e %b %Y, %H:%M %Z|agohover

don't forget to setup (in case of google applications for domains) an spf on you dns control panel.
if you don't do this, you could be marked as spam by cbl or others.

unfold by Giovanni SavastanoGiovanni Savastano, 1212337781|%e %b %Y, %H:%M %Z|agohover
Add a new comment
page_revision: 2, last_edited: 1201654819|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License