Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

Email setup gmail: diferència entre les revisions

De MoodleDocs
Salta a:navegació, cerca
cleanup
→Tips and tricks: add See also email settings
Línia 33: Línia 33:


* Some sites may need an additional step to un-comment the '''php_openssl.dll''' extension in <tt>php.ini</tt>.
* Some sites may need an additional step to un-comment the '''php_openssl.dll''' extension in <tt>php.ini</tt>.
== See also==
[[Email settings]]

Revisió del 10:09, 22 ago 2008

Google's mail servers can be set up as the SMTP server for Moodle. This reduces or eliminates the need for an email service on a server and is especially useful if Google Apps is used by the institution using Moodle.

This will require a hack to the code.

Email settings

Location: Administration > Server > Email

SMTP hosts: smtp.gmail.com:465 NOTE: Leave out the port (:465) in 1.9.2 or lower

SMTP username: Your email address @gmail.com or your own domain if using Google Apps

SMTP password: password for the above email account

Code Modification

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

class.smtp.php

Around line 83 DIRECTLY after the Connect function header, so the next line after the { add:

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

Code Modification (1.9.2 or lower)

These two additional modifications need to be made in 1.9.2 or lower as the SMTP hosts setting above will not allow the port to be included.

class.phpmailer.php

around line 162

  • Change var $Port = 25; to var $Port = 465;

class.smtp.php

around line 30

  • Change var $SMTP_PORT = 25; to var $SMTP_PORT = 465;

Tips and tricks

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

See also

Email settings