Hi,

I have gone through the install process, everything is fine, now I have to login and I get this message after clicking the "create new account" button:

warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\programmi\easyphp1-8\www\drupal\modules\user.module on line 394.

How can I connect to a mailserver from my localhost? I have checked other threads on this topic, really tried hard to search a solution, but I failed miserably. :(

Here's my configuration:

drupal-4.7.0-beta4
apache 1.3.33
php 4.3.10
mysql 4.1.9

OS: Win XP Pro

One more thing, I access the internet through a proxy, might this be an additional thing to take care of?

If you can help I'll be grateful.

Thanks in advance

Comments

Roberto Gerola’s picture

You should insert the configuration of your SMTP server in php.ini file.
It is the SMTP server of your internet provider.

likos’s picture

I am in an intranet and I have access to the web through a proxy. I'm trying to get Drupal working on localhost.

I'm trying to work out the configuration by myself by looking up the settings of my mail client: Lotus Notes 6.5. But what exactely do you mean with "the configuration of your SMTP"?

Once I've found it shall I put it here?

[mail function]
; For Win32 only.
SMTP = localhost

Also I have php.ini in three different places, shall I configure all of them:

..\EasyPHP1-8\apache\php.ini
..\EasyPHP1-8\php\php.ini
..\EasyPHP1-8\php\conf_files

Given my total lack of knowledege on mail configuration, thanks so much for the patience.

erdemkose’s picture

Do you have an SMTP server running on your machine. I think you don't because you didn't mention about it.

To connect to an SMTP server you should first have an SMTP server running.

You can use the SMTP server of WinXP Pro. You can access it from "Administrative Tools". You must enable relaying by adding necessary domains to your domains list. You can add them by wildchars like *.com and *.net.

If you have an SMTP server give us details of it.

+Signature------------------------+
|____________erdemkose____________|
+---------------------------------+
likos’s picture

No, I don't have an SMTP server. Thanks for making me realise this. Now seems so obvious!

I tried to do waht you asked for but unfortunately I don't have phisically the CD-Rom to install the mail server. I made a request of it though. Since it will take days, I've tried to see if there was an open source mail server for Win but I didn't find one. Sendmail, Postfix, and others have gnu licence only for Linux.

There seems to be a lack of it. Perhaps I didn't search well. In the end, I've installed "Free SMTP Server".

How do you make drupal aware of this mail server? configuring the php.ini?

The mail server is set to autodetect DNS on SMPT port 25.

Thanks your for your help.

PS:I made a typo my OS is Win 2000 pro.

grcm’s picture

SMTP mail servers are normally on port 25 which is where your Drupal site is looking. (Let's ignore encrypted SMTP for the time being- you probably don't want to get involved in that.)

Your SMTP software should have some sort of configuration options, but the defaults will most likely be to run on localhost port 25. That's standard.

From there, you probably need to tell your SMTP software where your ISP's mail server is (e.g. smtp.wanadoo.com)

-- Version Control and a Drupal web site with The File High Club

styro’s picture

It sounded like you used Notes. Could you point PHP at your intranets Domino server? I'm pretty sure Domino talks SMTP.

Or if you want a free Windows SMTP server, Google for Mercury.

--
Anton

likos’s picture

Hi,

I've installed an smtp server (Pegasus 4.31) and now I can send mails from it.

The problem is: how can I make Drupal aware of this mail server so that I can finally receive this mail with the login info?

I keep on receiving this message:

warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\programmi\easyphp1-8\www\drupal\modules\user.module on line 394.

Also I have run-out of available email addresses, it seems that once drupal get a username + email then you can't use any more that email address for other users. why?

Do I have to reinstall drupal?

Thanks again for your support!

likos’s picture

Actually, I have installed a mail client (Pegasus) with the SMTP server name I was provided and after checking I could send post through it, I have managed to log in Drupal after writing the smtp server name in the php.ini where before it was SMTP=localhost.

After all this, I got to http://127.0.0.1/drupal/?q=user/12/edit
to be said "Access denied"

Do I have to reinstall everything?

Thanks again for you help

styro’s picture

You've successfully discovered that the SMTP setting is a PHP thing not a Drupal thing and it looks like that is now working.

On to the access denied bit...

Is the error message from Drupal (it should be themed) or from the webserver (itwould mention the webserver name etc)?

Can you log in to Drupal successfully?

Are you logging in with an account that can edit users?

--
Anton

likos’s picture

The access denied msg was coming from the edit account page after I logged in.

I have recreated the DB and run Drupal again.

This time everything worked: I received the mail first time, I logged in and got directed to my account page where I successfully changed my password.

Now I can start getting to know Drupal from the user point of view which is my main concern.

Thanks again you all.

underpressure’s picture

I have a similar issue can anyone help?

my thread http://drupal.org/node/43120

my host thread http://jewlzk.com/forums/showthread.php?t=157&page=3

this issue has me truly underpressure

Regards,
underpressure
http://ravalonline.com

Patrick Van Rinsvelt’s picture

Can't help but would love to know the answer. My phi.ini settings are correct and I have even tried
to use the SMTP module. Also checked firewall settings on local machines and router.

Pat

rajaneesh’s picture

warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\programmi\easyphp1-8\www\drupal\modules\user.module on line 394.

kggmvmv’s picture

I installed XAMPP, and that went okay.
I started the XAMPP control panel.
I started Apache and MySQL.
I didn't start the FileZilla server,
as I can just copy files from one part of my PC to the other.
And I didn't start Mercury,
as I had no intention of sending or receiving mail to/from anyone
on my own PC or the other PC's in my house.
It was a little strange going thru the Drupal configuration,
because it asked for an email address a couple of times,
but I finally just put my internet email address in,
and it seemed to accept that.
But I finally arrived at the final page, "Drupal installation complete",
saying "Congratulations, Drupal has been successfully installed.",
but with the same (or very closely similar) error message others have gotten:

* warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25,
verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
in D:\Program Files\xampp\htdocs\_drupal\includes\mail.inc on line 193.
* Unable to send e-mail. Please contact the site admin, if the problem persists.

kjholla’s picture

I have just installed Drupal 6.9 on my Webhost. Webserver is IIS.

I have to put in details of my SMTP Server and Port. Is there anyway I can do this on Drupal without modifying the PHP.ini file? I don't have access to the PHP.ini file on the Webhost.

I am getting the following error:

* warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Domains\mydomain.com\SubDomains\drupal\includes\mail.inc on line 193.
* Unable to send e-mail. Please contact the site admin, if the problem persists.

I tried looking through C:\Domains\mydomain.com\SubDomains\drupal\includes\mail.inc on line 193 but did not find any ini_set() function there.

Can anyone help please?

kjholla’s picture

Finally got it working!

I installed the SMTP Authentication Module and it now works like a charm!!

However, I still don't now what ini_set() in the Error message thrown by Drupal refers to. Perhaps this is an error that the Drupal team needs to look at? Or perhaps the error message needs to give more details on what exactly needs to be done?

styro’s picture

However, I still don't now what ini_set() in the Error message thrown by Drupal refers to.

The error message is a PHP one not a Drupal one. ini_set() is a PHP function to change (where allowed) the configuration values normally set in the php.ini file:

http://php.net/manual/en/function.ini-set.php

--
Anton

djoaquin@yahoo.com’s picture

I realize this is along the same lines as all of thes eother posts, but ...
I am buidling my site with the latest drupal 7 download including all of the other add-ons (e.g. apache and mercury). I cannot get the mail process to work. I get the same error messages indicated in this thread.
- Do I need to rebuild the database (MySQL)? If so should I see any tables related to smtp?
- Do I specifiy mercury smtp in the php.ini file. If so do I simply replace "localhost" with "mercury? Tried that but perhaps there is something else I need to do?

Not sure the proper syntax for including ini_set() in php.ini.

Thanks in advance for your advice. Currently a durpal dupe.