By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

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

P: 7
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
Share this Question
Share on Google+
4 Replies


ak1dnar
Expert 100+
P: 1,584
Is it a Error message? when its getting?
May 9 '07 #2

P: 7
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
Expert 100+
P: 1,584
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
Expert 2.5K+
P: 3,235
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

Post your reply

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