473,473 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Unable to connect to localhost to send SMTP mail.

11 New Member
Hi all, im creating a mail form in PHP and I got back the following message in when testing:

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\email_script.php on line 38#

As you can tell from the localhost reference I am using a server on my own computer for testing purposes.Is this the only reason why it wont work or can it actually be fixed by changing the port settings in the php.ini file? If so does anyone have any idea how I would do this, I dont know anything about port numbers so im stumped.

In reference to the latter part of the error message I substituted the 'mail' command for the ini_set() reference but just got a parse error on line 38# message.

Thanks in advance,

Martin
Jun 7 '07 #1
8 2797
pbmods
5,821 Recognized Expert Expert
Changed thread title to give a better description of the problem.

Try using 127.0.0.1 instead of localhost.
Jun 7 '07 #2
ronnil
134 Recognized Expert New Member
have you setup an SMTP server on your localhost? if not, you will need to give it the same settings as you do with your regular email account for outgoing mail.

I suppose there are sort of free SMTP-servers out there for testing purposes but got no idea where. You can however also setup your personal testing server for use with php only, this way you can actually keep the mails from ever being send out but you will be able to monitor it anyway.

the "localhost" setting in php.ini is standard, so don't count on that.
Jun 7 '07 #3
Motoma
3,237 Recognized Expert Specialist
What operating system are you using?
Jun 7 '07 #4
epots9
1,351 Recognized Expert Top Contributor
hey Martin84,

i tried the same thing and got the same error as u, what u should do is use the same stmp that your ISP gives u, worked for me.
Jun 7 '07 #5
Martin84
11 New Member
I used WAMP5 to set up apache, php, mysql without configuring anything, I dont think this has set up an SMTP service as well. Do you hnow how you would go about scripting to give it (localhost)the same settings as the regular email account for outgoing mail? Im using a yahoo service by the way, if that has any relevance.

I tried the 127.0.0.1 thing but it didnt work, seem as its just another way of writing localhost
Jun 7 '07 #6
Martin84
11 New Member
Im using windows xp (home edition). Hi Epots9, how do you find the stmp that the ISP gives and how would you set it up? Im a complete novice when it comes to dealing with servers, hosts etc
Jun 7 '07 #7
Motoma
3,237 Recognized Expert Specialist
Typically the easiest solution on a Windows install is to download and configure one of the various free SMTP servers around.
Jun 7 '07 #8
epots9
1,351 Recognized Expert Top Contributor
to find your ISP's smtp, go to their site and u'll have to search or read the FAQ for it, try looking for "setup outlook", if they have any topics it will give u the pop address to use and the smtp address to use. just put the smtp address in the php.ini

or post the URL to your ISP's site (or name of ISP) and i'll try and find it for u

good luck
Jun 7 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: aa | last post by:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini in php.ini I have: SMTP = localhost SMTP_PORT = 25...
12
by: James Lankford | last post by:
Hello group: I have reached the end of my rope with this error. I have pretty much tried every suggestion I've found thus far and I get this error no matter what I do. I did try using the CDOSYS...
5
by: Nathan Sokalski | last post by:
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send() method. My code contains all of the following: Dim mailmsg As New Mail.MailMessage Mail.SmtpMail.SmtpServer =...
3
by: nickyeng | last post by:
i know alot of people faced this problem before. i searched google.com i search javaranch.com, no one article can help me solve the problem. I runs it in my localhost server, it runs well. But...
1
by: grace01 | last post by:
Hello, My php program can send mail on php 5. But some of other php programs cannot work on php 5, so I switch to php 4. Now my php program cannot send mail. I use remote smpt server to send mail....
3
by: =?Utf-8?B?U3JpZGhhcg==?= | last post by:
Hi, I have created a windows application to send the emails. Following is the code I am using. Dim errMsg As String Dim ToAddress As String Dim FromAddress As String Try ToAddress =...
1
by: Benedict Verheyen | last post by:
Hi, i get an "Unable to relay for" when trying to send an email from within my network to an email address not on my domain. I don't understand why it says "relaying" as i'm sending from an...
5
by: Carmine [www.thetotalsite.it] | last post by:
Hi everyone, I get a really odd error while using SMTPClient.Send() function in ASP.Net. The error is the following: Dim smtp As New Net.Mail.SmtpClient("smtp.thetotalsite.it", 25) Dim bodyMSG...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
0
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.