Email setup gmail: Difference between revisions

From MoodleDocs
(s)
 
(Reformat, interesting page)
Line 1: Line 1:
Hello. I run Moodle and my project uses the Gmail 'domains' service where we use Gmail as our email processor. IE: We have no email service on our server, we use Googles.
Google's gmail can be set up as an email processor for Moodle. This is reduces or eliminates the need for an email service on a server.  For example: when Moodle is used to train new developers/staff.


We run Moodle to train new developers/staff and so we needed the emails from the courses and Ask a Question type module.
This will require a hack to the code.


I was able to get Gmail working under these conditions by doing the following:
==Steps in site administration block==


In the Email section for smtp host I used: smtp.gmail.com
In the site administration block in the Email section for smtp host use:  
My @theseventhsungame.net email (Which again we use Gmail domains..)
smtp.gmail.com
The above email's password.
My @theseventhsungame.net email (Use Gmail domains)
Password should be set to the above email's .




I then opened /lib/phpmailer/ and modified the following files:
==Steps for code hack==
On the Moodle site go to  /lib/phpmailer/ and modified the following files:


class.phpmailer.php  
class.phpmailer.php  
around line 162  
around line 162  
 
*Change var$Port =25; to 465
I changed var$Port =25; to 465


class.phpmailer.smtp
class.phpmailer.smtp
around line 30
around line 30
*Change var $SMTP_PORT = 25; to 465


I changed var $SMTP_PORT = 25; to 465
class.phpmailer.smtp file
 
around line 83 DIRECTLY after the Fucntion header, so the next line after the {
In the class.phpmailer.smtp file
add:
around line 83
*$host='ssl://' . $host;  
 
DIRECTLY after the Fucntion header, so the next line after the {
I added:
$host='ssl://' . $host;  
 
I am now sending mail using the GMAIL feature.


http://www.theseventhsungame.net
==Completed==
http://www.theseventhsungame.net/tssuniversity


Hope that helps someone =)
This setup will allow Gmail to work with for example:


Sincerely,
http://www.theseventhsungame.net
Chel Ramsey
http://www.theseventhsungame.net/tssuniversity
admin@theseventhsungame.net


==Tips and tricks==


PS an additional step you may or may not need to take is to Un-comment the php_openssl.dll extension in php.ini I did not have to do this.
* Some sites may need an additional step to Un-comment the php_openssl.dll extension in php.ini.

Revision as of 11:18, 26 July 2008

Google's gmail can be set up as an email processor for Moodle. This is reduces or eliminates the need for an email service on a server. For example: when Moodle is used to train new developers/staff.

This will require a hack to the code.

Steps in site administration block

In the site administration block in the Email section for smtp host use: smtp.gmail.com My @theseventhsungame.net email (Use Gmail domains) Password should be set to the above email's .


Steps for code hack

On the Moodle site go to /lib/phpmailer/ and modified the following files:

class.phpmailer.php around line 162

  • Change var$Port =25; to 465

class.phpmailer.smtp around line 30

  • Change var $SMTP_PORT = 25; to 465

class.phpmailer.smtp file around line 83 DIRECTLY after the Fucntion header, so the next line after the { add:

  • $host='ssl://' . $host;

Completed

This setup will allow Gmail to work with for example:

http://www.theseventhsungame.net
http://www.theseventhsungame.net/tssuniversity

Tips and tricks

  • Some sites may need an additional step to Un-comment the php_openssl.dll extension in php.ini.