473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

[function mail() Windows XP]SMTP localhost

Hi,

I'm trying to send an e-mail from a .php script and ie6 returns this
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:\wamp\www\PAMWD\chap11email\sendmail.php
on line 12

I checked php.ini (line 606):

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

OTOH I didn't find "smtp_port" in php.ini

Maybe I should add :80 as port in php.ini?

Apr 4 '06 #1
5 12311
universalbitmapper wrote:
Hi,

I'm trying to send an e-mail from a .php script and ie6 returns this
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:\wamp\www\PAMWD\chap11email\sendmail.php
on line 12
Yes, the IIS return such an error (not IE) when it cannot connect to a
smtp-gateway.

I checked php.ini (line 606):

[mail function]
; For Win32 only.
SMTP = localhost
That is wrong
the next line should be
smtp_port = 25

At least that is in every single php.ini file I ever saw. :-)


OTOH I didn't find "smtp_port" in php.ini

Maybe I should add :80 as port in php.ini?


Huh?
port 80 is NOT for smtp.
port 80 is typically used for http.
use 25 for smtp.

And also: Are you sure you are running software on your localhost that
accepts smtp-commands?

If you are unsure, make the smtp-gateway something that you know to work,
like your own ISP-smtp-gateway.

Regards,
Erwin Moller

Apr 4 '06 #2
You should have SMTP server running on localhost, or consider using
your ISP SMTP.

Behzad Nategh

Apr 4 '06 #3
Hi,

Many thanks for your replies.

I added the smtp_port = 25 line in php.ini and restarted WAMP, now I
still get the warning, but I receive the e-mail sent from php.
I have found a "SMTP on Windows" tutorial, it looks easy enough, only I
wonder if this new SMTP service won't conflict with Apache ??
Jean-Benoit MORLA

I been flamed so often I'm a KFNewbee

Apr 4 '06 #4
universalbitmapper wrote:
Hi,

Many thanks for your replies.

I added the smtp_port = 25 line in php.ini and restarted WAMP, now I
still get the warning, but I receive the e-mail sent from php.
Good so far.
But still a warning?
That is strange: You receive the email, that means everything works as
expected and your localhost can handle the mailrequest, but PHP still
produces the same warning saying it cannot connect to the SMTP-server on
localhost?

I think you still have some problem somehow. :-/
(You guessed)

Maybe you better show us some mailing-code you made so far.
I have found a "SMTP on Windows" tutorial, it looks easy enough, only I
wonder if this new SMTP service won't conflict with Apache ??
No, appache don't care what PHP does when mailing (as far as I know).

If you use a different OS, you need to check the mailsettings. (For *nix you
typpically use a program called 'sendmail', but that is of no concern to
your current problem.).


Jean-Benoit MORLA

I been flamed so often I'm a KFNewbee


By the way: What is a KFNewbee?

Regards,
Erwin Moller
Apr 4 '06 #5
Kentucky
Fried
Newbee

You really opened my eyes with your replies, I discovered that I did
not have Microsoft IIS on my XP home,
so I downloaded Argos SMTP free, now it's installed, I still get error
message "unknown user" from the
php line where the $from variable is set, but I think I'll fix it soon,
just by looking at the tabs and the menu
options I slowly get the whole picture.

Many many thanks from Paris, Kentucky

Jean-Benoit MORLA

Apr 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alex Hunsley | last post by:
I am using the smtp module to send emails via a local SMTP server on our network. I am failing with "connection refused" error, even though we definitely have an smtp server running on port 25! ...
1
by: Paul Muns | last post by:
I have got the server working on Win XP Pro according to Winmysqladmin.exe. I have a password in my.ini but when I go to CMD to login to root, it gives me: "ERROR 1045: Access denied for user:...
2
by: tma | last post by:
Is there a way to send username and passwords to a mail server using code similar to below? My email server requires a username and password to send mail. Private Sub MailError(ByVal...
8
by: marcmc | last post by:
Trying to send an eMail frommy vb.net App. Is there anybody out there that has successfully done this? I am having major problems and need a step by step guide into the world of system.web and...
1
by: ashim.chowdhury | last post by:
While using mail() function in PHP I am getting thjis error Warning: mail(): SMTP server response: 505 5.7.3 Must issue a STARTTLS command first I have used...
1
by: mpaine | last post by:
Hi, I am trying to write .eml files to a remote UNC directory - do you know if this could be done, such as: <mailSettings> <smtp> <network
3
by: Keith Hutchison | last post by:
I've written an utility that enables me to send SMTP mail from MS Access using DDE and a custom VBA object.. I've got a client who is unable to install the utility due to company policy. I'm...
0
by: nituja | last post by:
Hi I want to send mail thru the program but I am getting above error. What I want to do is to send mails thru the program and recieve in my inbox ..... I dnt know how to proceed what SMTP...
6
by: phpmagesh | last post by:
Hi, I am using mail function in my php page, As soon i update the details, i have to send mail to the customer with the updated details, problem is when i send mail it simple through waring msg...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.