473,840 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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\PAM WD\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 12336
universalbitmap per 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\PAM WD\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
universalbitmap per 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
25442
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! the code is like this: me = 'ahunsley@companyname.com' you = 'someonelse@companyname.com' msg = '*** alert'
1
1736
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: 'root@localhost' <Using password: YES>" I am the system admin. I am however not using 'localhost' as such since I am behind a router that has assigned this workstation: 192.168.0.3. The USER and HOST are clearly shown in winmysqladmin.exe, like...
2
2000
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 ErrorMessage As String) Try Dim _mm As New MailMessage
8
5476
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 IIS. The reading I have done(alot) has been pretty useless in helping me understand the various bits required. The error I get is: On a pc running win2k with IIS and Lotus Notes System.Runtime.InteropServices.SEHException: External component has...
1
9348
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 ini_set("SMTP","mail.subdomain.mydomain.");
1
2157
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
2790
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 looking for some example VBA code that that can be used from within MS Access to send email. Requirements 1. Ability to set the from address 2. Ability to send mail without throwing a dialog
0
1815
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 configuration I hv to do , the only details I hv is mail server ip Thanks, Nitu
6
5205
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 as: can anyone help me why such problem occurs, how to over come this problem.
0
9861
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10605
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10301
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7839
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7023
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4078
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3139
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.