473,326 Members | 2,337 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,326 software developers and data experts.

Warning: Failed to connect to mailserver, verify your "SMTP" setting in php.ini

i am using IBSERVER and trying to mail a form to my email address my code is given below

form.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <form method="POST" action="mail.php">
  6. Name: <input type="TEXT" name="subject">
  7. Email: <input type="TEXT" name="email">
  8. <input type="SUBMIT" name="Submit" value="ok">
  9. </form>
  10. </body>
  11. </html>
  12.  
mail.php
Expand|Select|Wrap|Line Numbers
  1. <?PHP
  2. $email = $HTTP_POST_VARS[email];
  3. $mailto="muskhere@gmail.com";
  4. $mailsubj="Form submission";
  5. $mailhead="$email";
  6. reset ($HTTP_POST_VARS);
  7. $mailbody="Values submitted from web site form:\n";
  8. while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
  9. if (!eregi("\n",$HTTP_POST_VARS[email])) { 
  10. mail($mailto, $mailsubj, $mailbody, $mailhead); 
  11. }
  12. else
  13. {
  14. echo("Error, no comments were submitted!");
  15. }
  16. ?>
  17.  
Jul 14 '07 #1
4 1969
Atli
5,058 Expert 4TB
Hi and welcome to TSDN!

To be able to use the mail() function you must have a working SMTP server and you must set the following lines in you php.ini file so they will point to you SMTP server.

Expand|Select|Wrap|Line Numbers
  1. SMTP = localhost
  2. smtp_port = 25
  3.  
Jul 15 '07 #2
Hi and welcome to TSDN!

To be able to use the mail() function you must have a working SMTP server and you must set the following lines in you php.ini file so they will point to you SMTP server.

Expand|Select|Wrap|Line Numbers
  1. SMTP = localhost
  2. smtp_port = 25
  3.  
THANKS very much for your replay
how can i have working SMTP server i am using IBSERVER
can you tell me how to do that thanks very again
Jul 15 '07 #3
THANKS very much for your replay
how can i have working SMTP server i am using IBSERVER
can you tell me how to do that thanks very again

i have tried it but it still not working can u help me further... please
Jul 16 '07 #4
Atli
5,058 Expert 4TB
I'm not sure what IBSERVER is, so I can't really give you any real advise on that system, but there has been a lot of discussion about this topic on these forums.

Check out these topics, they might help you.
http://www.thescripts.com/forum/thread670549-SMTP.html
http://www.thescripts.com/forum/show...12#post2216412
http://www.thescripts.com/forum/thread662973-SMTP.html
Jul 17 '07 #5

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

Similar topics

2
by: Mike Obiku | last post by:
First of all, I'm new to PHP. For my website I have some PHP scripts to run a photo database. New users have to register them selfs. After registring the new user is getting an e-mail maid by an...
1
by: King Kong | last post by:
Hi it seems this has been discussed various times. Although I cannot find a solution. Ebvironment: Win 2k Apache 2 PHP 4.3.7 I use the module mode and not the cgi mode. I cannot send email...
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...
2
by: Martin Lucas-Smith | last post by:
I'm finding when a mail is sent from a script, I get: Warning: mail() : Failed to connect to mailserver at "smtp.ntlworld.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or...
2
by: Copelandia Cyanescens | last post by:
Python Python 2.3.4, Windows, "clean" install, using the example code given in the documentation, I get this... Traceback (most recent call last): File "C:\projects\email\email.py", line 24, in...
5
by: universalbitmapper | last post by:
Hi, I'm trying to send an e-mail from a .php script and ie6 returns this error: Warning: mail() : Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port"...
4
by: Screaming Eagles 101 | last post by:
How can I make my own Mail control (unvisible one) to use with a form ? Does anyone know where to find code ? I would like to fill in some parameters, and then send a mail, a bit like this : ...
9
bonski
by: bonski | last post by:
hello everybody.. i just want to know what this error means... Error: mail() : SMTP server response: 501 #5.1.1 bad address the smtp set up was correct.. valid emails... and port. so im just...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.