Author Topic: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and  (Read 44677 times)

0 Members and 2 Guests are viewing this topic.

Offline cluceTopic starter

  • Enthusiast
  • Posts: 354
    • View Profile
I am trying to send an email through a web form but I am getting an error......
I am trying to use windows xp on my local machine.

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:\wamp\www\sendmail.php on line 19

Can someone tell me how to fix this.
Here are my config settings for the mail server.....

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

; For Win32 only.
;sendmail_from = me@localhost.com


Offline Lumio

  • Devotee
  • Posts: 677
  • Gender: Male
    • View Profile
Maybe your Mailserver isn't running
greetings
-Lumio

I don't test most of my posted code

Offline ToonMariner

  • Fanatic
  • Posts: 3,715
  • Gender: Male
    • View Profile
the smtp has to be set to your service providers server.

I am on telewest so my php.ini files shows

SMTP = smtp.blueyonder.co.uk
follow me on twitter @PHPsycho

Offline cluceTopic starter

  • Enthusiast
  • Posts: 354
    • View Profile
well I am doing all my testing on the local machine using a localhost. My company email is @reaganpower.com but I am not using their email server for testing, I will only use my work email to recieve the message after submitted. So I am not sure if I am supposed to use my work email b/c I am not using their email server for testing that is all done on my local machine.

Offline ToonMariner

  • Fanatic
  • Posts: 3,715
  • Gender: Male
    • View Profile
no use who ever provides your internet connection at home...

they will have a mail server that you should use for outgoing messages.

reply with your service provider and i will go look for the server you need
follow me on twitter @PHPsycho

Offline neel_basu

  • Devotee
  • Posts: 593
  • Gender: Male
  • http://www.zigmoyd.net
    • View Profile
    • Zigmoyd Php Framework
To know whats the real fact you need to run the SMTP Commands in port 25 of that domain. to do it easily You can use this
Code: [Select]
<?php
$mail 
= new mail("admin@localhost""Subject""Mail Body");
//Just add a Simple hack here to show the SMTP conversation
$mail->show_cnv true;
//3 Arguments Are Given
//$mail = new mail("to@domain", "Mail Subject", "Mail Body");
if($mail->send())
    {
        echo 
"Mail Sent Succfully\n";
    }
else 
    {
        echo 
"Sorry Mail Sending Failed\n";
        
print_r($mail->error);//Print The Errors
    
}
?>
You will find the mail class here
http://zigmoyd.sourceforge.net/man/mail.php
PLease dont use the current version use the Previous version.
But please see the Installetion and Instruction on this Page http://zigmoyd.sourceforge.net/man/index.php

And if you dont wanna use this class use it for first time and see teh commands it sends and send those commands Manualy.
Zigmoyd Php Library / Extension -> http://www.zigmoyd.net
-----------------------------------------------
Hi I am Neel Basu. You can add me On Your msn Messenger Friendlist I am neel_basu_2005@msn.com