Trouble setting up SMTP

Trouble setting up SMTP

by Lynn Daley -
Number of replies: 7
Hi I'm just starting out with moodle and feeling rather out of my depth. Everything was going fine until I tried messaging. I've set up a few dummy users with my email address but can't seem to get the settings right.

My moodle is hosted with hostmonster so I'm a bit limited as to what I can do. I've tried sending messages with the SMTP bit left blank but I get the error message "ERROR: Could not instantiate mail function."

If I fill in the SMTP details I've been given by hostmonster I get the error message: "ERROR: SMTP Error: Could not connect to SMTP host."

As far as I am aware the details are correct and I can certainly receive mail with my email client. However, from reading round the forums I assume that moodle is trying to use port 25, but hostmonster is using port 26 (quite what that actually means is beyond me!). If this is the likely cause of the problem, is there anything I can do?
Average of ratings: -
In reply to Lynn Daley

Re: Trouble setting up SMTP

by Richard Enison -

LM,

If your host really is using a non-standard port number for SMTP, the solution would be to find where in Moodle the code is for connecting to the SMTP server, and change the port from 25 to 26. However, this would also require all e-mail software (like Outlook, Eudora, etc.) to be re-configured to use port 26 for sending mail, just because some clown at hostmonster has a whim to use a different port number from everyone else in the world. That is hard to believe.

RLE

In reply to Richard Enison

Re: Trouble setting up SMTP

by Lynn Daley -
Hi Richard,

I got no help from hostmonster, who said it was a problem with moodle, but a few users on their forums provided the answer, which was to leave out all smtp details but make sure the noreply email address was valid.
Average of ratings: Useful (1)
In reply to Lynn Daley

configure moodle for non standard smtp port

by Charles Brown -
4/2/2008

I successfully got moodle 1.9 to use a non-standard smtp port ( 587 )

Modify 2 files located in /www/moodle/lib/phpmailer/ directory

modfiy class.phpmailer.php
var $Port = 587;

modfiy class.smtp.php
var $SMTP_PORT = 587;

Good luck ... Charles

PS Of course under moodle Administration / Server / Email, you need to update SMTP host (smtphost) , SMTP username (smtpuser), & SMTP password (smtppass) with the values that are correct for your ISPs smtp server.
Average of ratings: Useful (1)
In reply to Charles Brown

Re: configure moodle for non standard smtp port

by Stephan van Haren -
why are you using port 587??
does this work for any smtp host??

In reply to Stephan van Haren

Re: configure moodle for non standard smtp port

by Marc Grober -
You can set your smtp daemon to respond on any port, and it appears that 587 is beginning to become popular where enterprises want to provide enteprise users with the ability to send mail from an external non-trusted host through enterprise mail to a non-enterprise address.
In reply to Lynn Daley

Re: Trouble setting up SMTP

by Clark Moodler -
Thanks for posting this! Helped me out years later in a big way!

clark