473,549 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php mail(0 sent but not received!!

50 New Member
hello
I have been trying to send email to a group of users found in my database, but the problem is the email is being sent but not received. I have also tried sending only to one recipient, it does not work either. I have already hosted my site

here is my code:

1st page

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Mailing List</title>
  4. </head>
  5.  
  6. <body>
  7. <form method="post" action="log5.php">
  8. <table align="center" bgcolor="#D6DEE7" border="0" cellpadding="0" cellspacing="0">
  9. <tr>
  10. <td align="center">
  11. <b><h2>MAILING LIST ADMIN</h2></b>
  12.  
  13.  
  14. Send message to:
  15. <select name="receiver" size="1" style="background-color: #F7F7F7">
  16. <option selected value="all">Reviewer</option>
  17. <option value="notall">Author</option>
  18. </select><br />
  19. <br />
  20.  
  21. Title or Subject: <input name="subject" type=text maxlength=100 size=40>
  22. <br />
  23. <br />
  24. Message:
  25. <textarea wrap name="message" rows=10 cols=45></textarea>
  26. <br /><br />
  27. <input type=submit name="submit" value="SUBMIT">
  28. </td>
  29. </tr>
  30. </table>
  31. </form>
  32. </body>
  33. </html>
  34.  
  35.  
and the log.php page:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. include("db_connect.php");
  3.  
  4.  
  5.    $tom = $_POST['receiver'];
  6.   $subject = $_POST['subject'];
  7.   $message = $_POST['message'];
  8.   $country = $_POST['country'];
  9.   $headers = 'From: myemail@yahoo.com'; 
  10.  
  11.   if ($tom == "all") {
  12. $result = mysql_query("SELECT Reviewer_email FROM reviewer");
  13.  
  14.     $count = 0;
  15.         while ($row = mysql_fetch_array ($result, MYSQL_ASSOC))
  16.         {
  17.         $to = $row['Reviewer_email'];
  18.         mail($to, $subject, $message, $headers);
  19.         $count++;
  20.         }
  21.  
  22.     echo "myResult=$count Emails Sent. Done.";
  23. }
  24.  
  25.  if ($tom == "notall") {
  26.  
  27.  
  28.     $result1 = mysql_query("SELECT Author_email FROM author");
  29.  
  30.     $count1 = 0;
  31.         while ($row1 = mysql_fetch_array ($result1, MYSQL_ASSOC))
  32.         {
  33.         $to = $row1['Author_email'];
  34.         mail($to, $subject, $message, $headers);
  35.         $count1++;
  36.         }
  37.  
  38.     echo "myResult1=$count1 Emails Sent. Done.";
  39.  
  40.  
  41. }
  42. ?>
  43. <html>
  44. <head>
  45. </head>
  46. <body>
  47. SUCCESS!
  48. </body>
  49. </html>
  50.  
  51.  
is there something wrong in my codes??
plzzz help
Mar 14 '09 #1
1 3471
Markus
6,050 Recognized Expert Expert
Here are some steps to help with debugging:
  • Turn On Debugging Messages.
  • Check your functions return true (i.e., they work) by using an IF conditional *.
  • Use the mysql_error() function to return any errors mysql generates for the current resource **.

Tell us any errors you receive.

Have you checked your spam box?

* Using an IF:
Expand|Select|Wrap|Line Numbers
  1. if ( mail( [...] ) )
  2. {
  3.     // mail was sent successfully.
  4. }
  5.  
** mysql_error()
Expand|Select|Wrap|Line Numbers
  1. $sql = "SELECT * FROM `tbl_1`";
  2. // If mysql_query() evalutes to false, die with query error.
  3. $result = mysql_query( $sql ) or die( mysql_error() );
  4.  
Mar 14 '09 #2

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

Similar topics

10
2628
by: NotGiven | last post by:
With the help from this group, I was able to change my Return-Path parameter seen in the full headers of email sent with mail(). Now I still see my userID in the parameter as shown here seen in my full headers of my email sent. Received: (from userID@localhost) by mydomain.com Any ideas?
1
3841
by: a c s | last post by:
Hi there, my problem is as follows: When emailing a file using PHP 4.0.6, the attachment received is an empty "attachment.txt" file instead of the actual file I attached. Any suggestions why this might be? (php from a kindly newbie site enclosed) Many thanks, Alan.
1
6365
by: Patrick Dunnigan | last post by:
Hi, I am attempting a bulk copy from a c program into SQL Server 2000 using DBLib in freeTDS 0.63 RC11 (gcc 3.4.3, RH 9). I am getting an error message that I cannot find any documentation on. The server is sending back the following: "Received invalid row length 2 from bcp client. Minimum row size is 4." I know the row is longer 2...
4
6385
by: zelzel.zsu | last post by:
I wrote two simple socket program. one for sending a file and the other for receiving the file. but when I run it, a curious thing happened. The received file was samller that the sent file. $ cat receivefile.py #!/usr/local/bin/python # -*- coding: utf-8 -*- import socket
2
2828
by: Brian | last post by:
Hello, As the subject says is there an api the will allow me to view the packets sent/received just like the icon for the network properties? Any links, examples are appreciated. Brian
1
1613
by: bonokoot | last post by:
Hello, I wrote this program in C# that accesses a SQL Server database that runs a stored procedure and sents the results in an email every 30min. I wrote this as a windows application instead of a windows service, so the application is run every 30min through a scheduled task. When the email is received the received time is ok, but the sent...
34
18164
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
2
6863
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless there is a problem with the connection. I need to know which client has sent the incoming data as each client has its own buffer on my "server"...
2
2607
by: Hughesie11 | last post by:
Im trying to post from a form to send an email, im using CDONTS ( I have to as it will be running on NT4), the object appears to get created fine, however the email is not sending, its generates 3 files in the C:\Inetpub\mailroot\Badmail directory they are .BDR, .BDP & .BAD files, here is the text of the .bad: From: postmaster@SERVERMNAME To:...
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7715
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7956
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3498
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1057
muto222
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.