Hello All,
I am new to Drupal Instalation. I am student and want to impliment an internelportal for discussions and knowlege sharing on the intranet of college. So i downloaded the XAMPP for this and drupal-5.x.x.
Its installed properlay and working through lan on other systems also. but the main problem i am facing is that when I am trying to create new acount or anybody is trying to create new acount then its not sending password in the mail using SMTP server. i found the error is

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:\xampp\htdocs\horizon\includes\common.inc on line 1970.

even i also changed the php.ini file to
[mail function]
; For Win32 only.
SMTP = 192.168.1.248
smtp_port = 25

; For Win32 only.
sendmail_from = kumar.mukesh@hotmail.com

here in this 192.168.1.248 is the ip address of our internel smtp mail server.

after chaing these in the php.ini i again found the same problem.

So please suggest the possible solution for this what else change i have to do so that i can make it work properlay in my college.

I hope for the positive response from all of you.

Thanks & Regards
Mukesh
kumar.mukesh@hotmail.com

Comments

mdixoncm’s picture

1. Did you restart apache after making the changes to php.ini?
2. Make sure your changing the right php.ini file - sometimes XAMP installs have the php.ini file in the apache dir - as well as one in the php dir (which isn't used)

Oh, and make sure that you don't have virus scan/firewall software stopping outgoing traffic on port 25 - this is quite common to stop mass mailing worms from sending mail from your machine.

Good luck

m

Like books? Check out booktribes the new (Drupal based) community for book lovers
from Computerminds

mukeshtalks’s picture

Hello m,
I tried this also but again not working. first time when i made changes in the php.ini file and run the Mercury mail server on my system it works when i shut down the system mercury mail server also closed and after restart the pc i started the mercury again but the same error again got.

So please suggest me the solution. and also tell me is any mail server is required on local host for mailing services or only changes in php.ini works.

thanks & regards
Mukesh Kumar

erika’s picture

I enabled the smtp module and tried to send a test mail.I get the following error.I need help in this regard.

* SMTP.module is active.
* The configuration options have been saved.
* SMTP.module is active.
* A test E-mail has been sent to username@gmail.com. You may want to check the logs for any error messages.

  * warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.
    * warning: fsockopen() [function.fsockopen]: unable to connect to dayspringsoft@gmail.com:25 (Unknown error) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.
    * warning: fsockopen() [function.fsockopen]: unable to connect to :25 (An established connection was aborted by the software in your host machine. ) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.

The log msg's show

fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to :25 (An established connection was aborted by the software in your host machine. ) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.

My firewall is turned off.I'm supposed to try using gmail not a dedicated server.I'm using drupal 5.x
Currently I'm using gmail,as I'm a newbie,

The line 1894 in smtp.module shows

  • * #connect to the smtp server
    $this->smtp_conn = fsockopen($this->protocol . $host, # the host of the server
    $port, # the port to use
    $errno, # error number if any
    $errstr, # error message if any
    line 1894 - $tval); # give up after ? secs

I'm fighting against my deadline..pl help me

mukeshtalks’s picture

Hello Erika,

there are couple of things to check:
1> smtp server address e.g smtp.domain.com
2>And the Smtp prt of the server you are using
3> your smtp server required authnentication or not

In general smtp server are using port 25 for sending mail. but in your case if you want to use smtp server of gmail the the smtp host server of gmail is smtp.gmail.com . Then smtp port for gmail is 585 instead of 25
and gmail's smtp server required authentication so you have to use the above settings and then try
i hope it will work.
could you please tell me you are working on local host or somewhere on web server. and on which platform windows/linux.

Mukesh Kumar

erika’s picture

Thanks mukesh for your time.
I'm working on a local host for now.I tried sending the mail,but I got the error
My Inputs

  • SMTP Server: smtp.gmail.com
  • SMTP port: 585

.I've given input in smtp authentication


I'm working on windows paltform


    * warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.
    * warning: fsockopen() [function.fsockopen]: unable to connect to smtp.gmailcom:585 (Unknown error) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.
    * warning: fsockopen() [function.fsockopen]: unable to connect to :585 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.


    * SMTP.module is active.
    * The configuration options have been saved.
    * SMTP.module is active.
    * A test E-mail has been sent to yourname@gmail.com. You may want to check the logs for any error messages.

log msg
Error sending email: "SMTP Error: Could not connect to SMTP host." From: "myname@gmail.com" To: "yourname@gmail.com"

please help me.I'm fighting against my deadline.Being a newbie its more difficult

mukeshtalks’s picture

Hello Erika,
Are you enabled the pop3 settings in the gmail settings in the forwardong amd pop menu.
if not first enable that and then try. sorry i given you the wron port for gmail smtp its 587. and see the settings of mail in the given link

http://mail.google.com/support/bin/answer.py?ctx=%67mail&hl=en&answer=12103

and then try its using secute TLS connection.

Try This.

Muku

erika’s picture

Hello Mukesh,
Thanks for your time..your help solved my problem to some extent...
Now I don't get the warning errors..but neither the mail is sent to the users


    * SMTP.module is active.
    * The configuration options have been saved.
    * SMTP.module is active.
    * A test E-mail has been sent to yourmail@gmail.com. You may want to check the logs for any error messages.

the log messages display

any ideas why is this happening.

erika’s picture

Hello Mukesh,
Thanks for your time..your help solved my problem to some extent...
Now I don't get the warning errors..but neither the mail is sent to the users


    * SMTP.module is active.
    * The configuration options have been saved.
    * SMTP.module is active.
    * A test E-mail has been sent to yourmail@gmail.com. You may want to check the logs for any error messages.

the log messages display

I've enabled pop settings in my gmail account

any ideas why is this happening.

ramper’s picture

In the past, I have been able to send mails from localhost using my gmail account. However, lately the same settings don't seem to work. After wasting a lot of time, this is what I finally came up with. But, for this, you would need either an email from your ISP or you should have your own domain, with email address such as 'yourname'@'yourdomain':

1) I installed the Uniform Server - a really compact WAMP set up.
2) Went through Drupal installation - you can create your 'admin' account (the first account) even without the mail feature working.
3) After taking care of the file system and cron jobs related warnings, I installed the SMTP module.
4) I configured the SMTP module using the SMTP settings for my mail server (at my domain). You can do this with your email from your ISP as well - you need to get their SMTP server and port information. (Like I said, I used to be able to do this using my gmail settings - but, for some reason, I am not able to do that anymore. Perhaps someone could point out how that can be done - especially if someone is using their gmail for sending mail from localhost right now).
As for the email and password, I used 'myname'@'mydomain'.com.
5) I changed the php.ini settings to
; For Win32 only.
sendmail_from = myname@mydomain.com
6) Restarted the server

It works fine - both for new member registration and for password requests.

I am very pleased with the Uniform Server for a test machine set up. I have to tell you though - the latest version of Uniserver (3.4) - looks really good, but I had some trouble with the database setup - so I actually went back to the earlier version 3.3.

Though my reply is very late, hope this helps someone :)

vagnk’s picture

Dear erika

Did you reach to a solution? I would be very interested having the exact same problem.

Vagn Kofoed
Denmark

vagnk’s picture

Dear erika

Did you reach to a solution? I would be very interested having the exact same problem.

Vagn Kofoed
Denmark

erika’s picture

I'mm extremely sorry...for some reason my recent posts didnt get updated with your replies...I almost lost hope in making the smtp module work usinig localhost...I'll try it and let you know soon
Thanks.hope your solution works.....

erika’s picture

I'mm extremely sorry...for some reason my recent posts didnt get updated with your replies...I almost lost hope in making the smtp module work usinig localhost...
I'll try it and let you know soon vagnk
Thanks.hope your solution works.....

erika’s picture

hi vagnk,
I was not successful in making the smtp module work....
I've a domain,I tried using the address of te outgoing server to make it work..all in vain..
I get the warning message


    * warning: fsockopen() [function.fsockopen]: unable to connect to my outgoing server id (An established connection was aborted by the software in your host machine. ) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.
    * warning: fsockopen() [function.fsockopen]: unable to connect to :25 (An established connection was aborted by the software in your host machine. ) in C:\programs\apache2.2\htdocs\modules\smtp\smtp.module on line 1894.

THe logs shows as follows
Error sending email: "SMTP Error: Could not connect to SMTP host." From: "myname@mydomain.com" To: "testid@gmail.com"

the line of cose in smtp.module is $tval); # give up after ? secs

Any suggestions

ramper’s picture

Hi Erika,
Sorry for the late reply - I haven't been checking the follow-up messages lately. I hope you have got your SMTP module working by now. (I can imagine the frustration if not yet...)
OK, this is not a technically rigorous suggestion. However, I'll once again talk about what worked for me:

From your error message, it seems like you must have used some kind of installer program to set up your WAMP package, which, by default, might have chosen the 'C:\Programs\Apache2.2\...' directory. While using the latest version of every program gives a very satisfying feeling, after some trial and error, I decided to go with a simpler, stand-alone setup that doesn't require any 'installation' as such - only unzipping of files...The WAMP set up I use is 'Uniform Server 3.3' (though version 3.4 is out, I still have some problem adding users and assigning database privileges - if someone has got version 3.4 working, I would like to know:)
So, basically the 'Uniform Server' can sit on any drive - it doesn't go through the Windows registry at all - so if you decide to move it or delete it, it is done cleanly. You can use the phpmyadmin that comes with the package to create your database. I copied the drupal files to the 'www' folder that is inside the Uniform Server (the 'www' folder is the root directory for the site). After going through the initial Drupal installation and taking care of the 'filesystem' and 'cron jobs' warnings, you can now copy the SMTP module, enable it and configure it by entering your email, password and SMTP settings. It should work. Please let me know.
Like I said, what I have suggested may have nothing to do with your problem - but for some reason, the set up I have described above works for me everytime - I have made a few trial Drupal installations lately.

ramper’s picture

Erika, as a last resort, if you need a complete email address of your own, with the SMTP settings, for testing purposes, you can use the contact form to contact me - I can create a temporary email address (with forwarding, if you like) for you on my domain and send you the SMTP settings. At least, that way you can narrow down your problem - that is, you will know if the problem is with your hosting set up. For some reason, I could not get any mail server program working on my windows machine (which would be ideal - that way, I can have everything in one place). Being a beginner myself, I tend to stick with what works for me while I focus on the site development - hence I can't offer you a more technical sort of help :)

erika’s picture

Thanks Ramper....
I finally figured out what the problem was.....i had virus scan enabled in my system and it prevented me in sending mails from local host...When I disabled it I was able to end mails....so for now I've disabled my virus scan,currently I'm working on local host...
I'm glad that there are drupallers like you who support newbies like me even its an old post...

showWayer-1’s picture

I encounter the error messages exactly what you got in sending email issue. You said finally you disenable the virus scan. what the virus scan is? how to disable it?

Thanks

Cai

erika’s picture

sorry for replying so late,hope you've would've solved the prob
open up the right tray (u view u'r system time there)in the desktop,you should've a virus scan icon,right click it and diable it.i use macafe virus scan ,i did it this way.hope this helps

dfang’s picture

sockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Permission denied) in /var/www/html/.../sites/all/modules/smtp.module on line 1878.

THe logs shows as follows
Error sending email: "SMTP Error: Could not connect to SMTP host." From: ".......@gmail.com"..

I disabled the SELinux via Security Level COnfiguration, the sending email problem solved.

mmr315’s picture

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:\Apache2.2\htdocs\mail.php on line 7

i changed in php.ini

SMTP=192.168.1.50
smtp_port=25

;for win32 only
sendmail_from = mahesh.reddy@shantasoft.com

here 192.168.1.50 is the ip address of internal mail server

i wrote code like this

=================

$to = "mahesh.reddy@shantasoft.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "mahesh.reddy@shantasoft.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";

please help me

thanks & regards

Madhu

mukeshtalks’s picture

Hello All,

I am facing problem in sending mail using drupal5.1x. i got the warning as displayed
warning: mail() [function.mail]: SMTP server response: 530 Authentication required in D:\xampp\htdocs\includes\common.inc on line 1970.

So please suggest me solution for the same problem.

Muku

randya’s picture

Hi,
I have PHP, Drupal and Email server all on the same Win2003 server. As far as I can tell the PHP.INI does not have any place for Username and Password which is needed to authenticate into the mail server. Elsewhere in Drupal website there are others talking of how to work around this by swapping Class or functions that provide for authentication. However, I would prefer the recommended method from the folks at Drupal if possible. Has anyone found a 5.0 way to fix this problem? Is it already fixed in some newer documentation?

Thanks,

Randy Ainslie
Keyosk.com Inc.

questions’s picture

Hi!
i request plz tell this issue

Bye..

g9mickey’s picture

Got the same 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
*************************includes\mail.inc on line 193.
Unable to send e-mail. Please contact the site admin, if the problem persists."

Im Using Drupal 6.2 and there doesnt seem to be an SMTP module for 6.2. Can I use the 5.x module in 6.2 ?
Is this problem solvable in 6.2?

Thanks
Mike

m.elisa’s picture

you can use SMTP module 5.x also for 6.2 version, but you have to use the patch

kendouglass’s picture

I found the most helpful information at "Managing Mail Handling for Development or Testing." See here: http://drupal.org/node/201981