I got the same problem. It occcurs when i leaf the smtphost blanck. If i put localhost in this field then there is this error:
How can i use localhost as SMTP host?
i've tried smtp.mail.localhost, mail.localhost, localhost, smtp.mail.myipaddress, mail.myipaddress, myipaddress.
I searched a little bit and found out that either a firewall blocks the port or the smtp ist not installed correctly in the php.ini.
So i guess i did it right in the php.ini. But is it possible that Apache blcoks this port? I don't know exactly but i tried to access via LAN and the computer that tried to access my IP tried it for a while and then reported page not found.
Can this be an Apache issue? And where can i find if Apache blocks this port?
If you have Outlook or someother mail client on your machines, what is the SMTP host set to on those? Chances are that it is exactly the same. Do you have a network administrator of some sort to ask?
I thought the phpmailer sends over the localhost. But when i try to send it over localhost i get the error this topic is about.
Isn't "localhost" the SMTP-Host for phpmailer?
If im totally wrong with this, then how can i find the set of outlook?
I guess im little bit too stupid for this
phpmailer (by default) sends using Sendmail which is a Unix/Linux thing - Windows doesn't have this. So, in a windows install you *must* set the SMTP server setting to a valid SMTP server. If your system has one you will know about it because you will have installed it
However, if you have outgoing mail working on your network it must be getting sent somewhere - and that somewhere is the SMTP server. But, again, someone must have set this up, so identifying that someone and asking is the easiest route.
I use a Mac and so am not all that familiar with outlook, but basically you are looking for a setup/configuration setting called services. In there you should find the settings for SMTP and POP (or possibly IMAP). You can simply lift the server setting from there. The possible problem is if you use Exchange. In that case you will certainly need to speak to your Exchange administrator.
however, it's doesn't seem to be fully functioning. it says that the email has been sent, but no email does get sent. ugh!
I tried qmail too, but if u look in ur Apache logs than u will find that apache doesnt find qmail, so i guess its not installed.
I will try to find it and to install on Apache.
And Howard thanks for ur patience.
I will post up new things i found out.
I am not sure who here is using Windows and who is using Linux however either way the easiest route is to determine a usable SMTP server on your network. If you are directly connected to the internet it will be your ISP's smtp server - ask them, they will tell you what it is! If it is your own network who set it up? Do you have mail at all on your network?
The 'qmail' thing is a hack for people running on Linux servers with the qmail mail server installed. This probably doesn't apply to you guys. Please don't try and install qmail - it is *very* difficult! Installing any MTA (Mail Transport Agent / Mail Server) is a tricky process requiring some fairly indepth knowledge of Internet technologies and is best avoided!
Most Linux/Unix installations come with Sendmail or some other MTA that emulates it (of which qmail is one example). In that case leaving the smtp setting empty will attempt to send mail using the Sendmail interface. However this will only work if your network is set up correctly so that mail works - so we are back to where we started. Your first step is to either get mail working on your network(s) or identify how they work now - none of this is really a Moodle issue.
Anyway, good luck
Hi, im using Windows and trying to send the Mails via LAN. This LAN is not connected to the Internet so i thought it would be a good idea if my WebServer Apache sends the Mails over the LAN.
But i think i understand what u mean - finally The Problem is i got no mail server on my localhost. So i found out, that i got to use Apache James for establishing a mail server.
So as long as im not using Apache James or something like that, the localhost wont send mails. Am i right?
I really want to make sure that you know what you are getting in to, please excuse me in advance if the following is perfectly clear to you...
Apache James is a (open source) Java based mail server - it has nothing to do with the Apache web server excepting that they are both under the same 'banner'. It is a completely separate issue. There are, of course, other MTAs for Windows both commercial/proprietary and open-source.
What you want is something that is often called a 'POP Toaster', that is the server keeps all the local email itself and users access it using the POP3 protocol from their email client (eg, Outlook, Eudora). So James will act as your SMTP server, it will recognise the mail as local and keep it for later collection (by POP3). Any other mail must be sent out to the internet which may well mean forwarding to an external (smtp) server. If you are not connected to the internet the latter does not apply.
Ok, let me resume: I need a programm that uses POP3 as an email client. James would do this. As long as im sending only inside the LAN James does this as SMTP-server.
But if i would use Linux i could use sendmail and all would be easier and php-mailer would work?
If so i better migrate to Linux
Mail is confusing because it was developed on Unix machines that work nothing like Windows. If you are unfamiliar with Unix then mail protocols seem weird. You just have to get used to that.
Moodle sends - using smtp - mail to the mail server on the same or a different machine. The machine has all the users configured there (there will be some mechanism for this) and stores the mail. The mail machine also needs a POP3 server running so that the actual users can pick up the mail from their remote machines. So you need both protocols running on the mail server. SMTP to accept mail from Moodle (and any other system that needs mail) and POP3 so that users can get it. POP3 involves a username and password so you should expect to have to set up each user on the server somehow.
Depending on the software you choose - this may all be a one-step process or you may have to install individual bits of software for each protocol.
Does this help?
PS. Things would be *much* easier if you used Linux - BUT! In your situation Sendmail wouldn't know what to do with your mail because you have no mail setup on your lan. But (again) it would be reasonable straightforward to set up the machine to act as a mail hub for your users as it is (at least) halfway there.
Thanks for ur answers, u were a big help. But i guess i test moodle without using its email function at first.
To set up an mail server i guess i choose linux but it seems to take a while to configure it as a mail hub.
Just one last question: If i would use my personal mail account at GMX , then it would be possible to send mails with moodle as long as im online?
Sorry for bothering u with so much questions
i finally got it! I got a nice lil Mail-Server called 'Hamster'. Its Freeware and for windows. And its working fine on my local host. I have only some troubles sending to real email adresses - they dont get delievered.
But i keep fighting
Thanks for your help
However, note that Windows does not come with a mail server (they want you to buy Exchange). You will know which machine it is because you will have installed the server.
To be honest, my preferred solution would be to dig up an old machine and install a basic linux installation on it to use for mail. Unix/Linux is *much* better at running mail that windows is - but it's still not entirely straightforward.
thanks for all of your help!
I have a valid SMTP server specified in my configuration variable and i get this message:
Warning: fsockopen() [function.fsockopen]: unable to connect to mail.templejc.edu:25 (An established connection was aborted by the software in your host machine. ) in C:\Inetpub\wwwroot\moodle\lib\phpmailer\class.smtp.php on line 105
ERROR: SMTP Error: Could not connect to SMTP host.
I saw a reference to this message in this dialog but I'm not clear what the resolution was.. We are attempting to run Moodle 1.5 on a Windows 2003 server.
We are using Apache not IIS but are getting something similar. All was well on Moodle 1.5 then we moved to a new server and upgraded to 1.5.2 and now we get the error about connection aborting by host.
Have you managed to crack your problem now and if so what fixed it please? We seem to be going round in circles now.
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = email@example.com
; For Unix only. You may supply arguments as well (default: 'sendmail -t -i').
Configure SMTP to where you have the MTA installed.
Sadly we already had those things configured.
We are on a Windows 2003 Server with Service Pack 1 installed using Apache not IIS. Has anyone got email running on this conguration? We are beginning to think that Port 25 is closed but there is no obvious way (that I can see) to open it.
Desparation approaches - willing to try most things.
I am running a Windows 2003 Server with Service Pack 1 and Apache.
I have got a problem trying to use send mails from moodle.
Here we go!
Warning: fsockopen(): unable to connect to smtp.ccoo.es:25 in c:\servidor\web\moodle\lib\phpmailer\class.smtp.php on line 105
Could not send you an email to confirm the password change
I used the outlook express with the same configuration that I use in moodle, and I could send and receive.
The mail server is in other machine, and I don't have any clue about what it is going on. I have the antivirus McAffee, if it can help.
Thanks for avance.
Opened port 26 in my (mcafee) firewall and altered php.ini default mailer to 26 (but moodle should use default if it can;t use 25 right)
All to no avail - strangest thing is that it worked once and then didn;t with no change in settings.
Going to study the email address/envelope for a few clues and post back
WE FOUND THE PROBLEM!!!
McAfee has its own mini firewall. Open the McAfee virus scan console and disable the port block rule for port 25, thats all!! Took us the best part of 2 weeks disabling everything in Server 2003 trying to figure this out before we realized the only diffs between the new server and the previous one was McAfee.
I am using Moodle 1.9.7 and the tracker module.
If a create a new issue and store it, i'll get the message: ERROR: Could not instantiate mail function.
The funny thing is, after pressing the continue button all the messages are sent correctly. It's just a little confusing for the normal user getting this error message.
Iam using linux, and the local mail-function, There isn't one of those smtp-entries filled outm, just in the config the entry $CFG->maildomain = 'myDomain.tld'; is set.
Can anybody tell, how to get rid of that error message ?
I had the same error message, with hosting in hostmonster and using the standard php mail function. After i removed the "No-reply address" from the email configuration (Administration -> Server -> Email) everything was fine!
Hi Carlos, do you know how to edit the default values for noreplyaddress and supportemail I need to leave it in blank (empty/vacio) in order to solve the email problem related in this topic.
Thanks in advance for your help
The solution for me was to edit php.ini as above and remove the noreply address and it sprung into life