471,078 Members | 774 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 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 2180
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

Post your reply

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

Similar topics

4 posts views Thread by Bogdan Chytrek | last post: by
reply views Thread by Lori McDonald | last post: by
5 posts views Thread by Nathan Sokalski | last post: by
6 posts views Thread by Dave Kelly | last post: by
2 posts views Thread by jephperro | last post: by
reply views Thread by sa6113 | last post: by
reply views Thread by leo001 | last post: by

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.