473,385 Members | 1,720 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,385 software developers and data experts.

Failed to connect to mail server error for mailing list using PHP

Expand|Select|Wrap|Line Numbers
  1.  //Index.php 
  2. <html><head><title>Mailing List Administration</title></head><body>
  3. <br>
  4. <center><H1>Mailing List Administration</H1></center>
  5. Send an email to a mailing list:
  6. <form method=post action="sendemail.php3">
  7. <table><tr><td>
  8. <b>From Address:</b>
  9. <input type=text name="From" size="40" value="">
  10. <br>
  11. <b>Subject:</b><input type=text name="Subject" size="40">
  12. </td><td><table cellspacing=15><tr><td valign=top>
  13. <b>List:</b> 
  14. </td><td>
  15. <select name="List" size=4>
  16. <? 
  17. $groups = file("lists.txt"); 
  18. for ($index=0; $index < count($groups); $index++)
  19. {
  20. $grouplist = split("\|", chop($groups[$index]));
  21. ?>
  22. <option value="<? echo $grouplist[1] ?>"
  23. <? if ($index==0)
  24. {echo "selected";} ?>
  25. <? echo $grouplist[0] ?><br>
  26. <?
  27. }
  28. ?>
  29. </select></td>
  30. <td valign=top><b><a href="newlist.php3">Make a new list.</a></b>
  31. <br><a href="addnames.php3">Add names to a list</a>.
  32. <br><a href="picklist.php3">Edit/Delete names</a>.
  33. <br><a href="data.txt">View Send Log</a>.
  34. <br><a href="autoresponder.php3">View/Edit Autoresponder</a>.
  35. </td></tr></table>
  36. </td></tr></table>
  37. Type or paste your message below:
  38. <br><textarea cols=50 rows=10 name="Body"></textarea>
  39. <br><br>
  40. <input type="submit" name="Submit" value="Send Mail">
  41. </form>
  42. <br>
  43. </body></html>
  44.  
  45. //send email.php
  46. <html><head><title>Updating file....</title></head><body>
  47. <?
  48. $addresses = file("lists/$List");
  49. for ($index=0; $index < count($addresses); $index++)
  50. mail("$addresses[$index]","$Subject",
  51. "$Body","From: $From\nReply-To: $From");
  52. }
  53. $myfile = fopen("data.txt","a");
  54. fputs($myfile,$Subject."\t".date("dS of F Y h:i:s A")."\t".$List."\n");
  55. fclose($myfile); 
  56. ?>
  57. Your message was sent!
  58. <br><br>
  59. <a href="index.php3">Home</a>.
  60. </body></html>
  61.  
Error message was a warning.

Here's printscreen of the error msg.
http://i179.photobucket.com/albums/w...i/errorMsg.jpg
May 9 '07 #1
4 2476
ak1dnar
1,584 Expert 1GB
Is it a Error message? when its getting?
May 9 '07 #2
Is it a Error message? when its getting?
Yes.
It seems like I hav to configure some port in outlook express.
Howeer, I'm unsure how to do so.
May 9 '07 #3
ak1dnar
1,584 Expert 1GB
PHP mail() function allows you to send mails over a Configured SMTP server.There is no relation with outlook and its ports with php mail.
If you trying to send mails over your Local web server refer to the php.ini file for the SMTP configuration.
Or your web server is a Internet based one check with your vendor whether php mail is enabled or not.
May 9 '07 #4
Motoma
3,237 Expert 2GB
You will need to set up an SMTP server, and configure PHP to work with it before mail() will function correctly.
May 9 '07 #5

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...
0
by: D. K. | last post by:
Hi; I have installed suse 8.2 a short while ago and at my first attempt to connect mysql (via shell and a perl dbi script) i get following error: can't connect to mysql server through socjet...
4
by: Bogdan Chytrek | last post by:
Why happens this? Warning: pg_connect() unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "bchytrek" in /var/www/html/physio2/test.php on line 19 The...
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...
0
by: Lori McDonald | last post by:
I have code that I am using to sent an HTML email. (see code below) Intermittently I am getting the following error when I try and send an email message from ASP.Net code on my server. 80% of the...
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 =...
6
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
2
by: jephperro | last post by:
Hi there, I have a problem using PHPMailer. On my local development machine, the script works fine and sends emails. On amy staging server, when I try to use PHPMailer to send() I see the...
0
by: sa6113 | last post by:
I am using this code to connect to a windows machine using paramiko, I have installed sshd on the machine and it works properly: sock.connect((hostname, port)) t = paramiko.Transport(sock)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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...

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.