Connecting Tech Pros Worldwide Forums | Help | Site Map

php mail bounced <full mailbox>

usafshah's Avatar
Member
 
Join Date: Nov 2006
Posts: 107
#1: Sep 26 '07
hi
i'm using php mail (running on windows 2003 server <built-in smtp> ) to send email to abc.com domain, the email is not reaching to the domain as i'm monitoring it. but as i run the script i get the following warning in browser:


Warning: mail() [function.mail]: SMTP server response: 452 4.2.2 Mailbox full in C:\Inetpub\wwwwroot\testdomain\phpmailer\index2.ph p on line 5

Message delivery failed...


here is the script that i used;

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $to = "recipient@example.com";
  3. $subject = "Hi!";
  4. $body = "Hi,\n\nHow are you?";
  5. if (mail($to, $subject, $body)) {
  6.   echo("<p>Message successfully sent!</p>");
  7.  } else {
  8.   echo("<p>Message delivery failed...</p>");
  9.  }
  10. ?>
when i try to send to gmail it works fine. but when i try to my exchange server i get the above warning but when i change the code to use auth it works fine for my exchange server

ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Sep 27 '07

re: php mail bounced <full mailbox>


When your server is set up to use mandatory headers, you need to add e.g. the "From: xxxx@yyy\n" in the fourth parameter of the mail command.

Ronald
usafshah's Avatar
Member
 
Join Date: Nov 2006
Posts: 107
#3: Sep 27 '07

re: php mail bounced <full mailbox>


ok i have changed the code to use header (from etc)

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $headers = 'From: abc@mydomain.info' . "\r\n" .
  3.     'Reply-To: abc@mydomain.info' . "\r\n" .
  4.     'X-Mailer: PHP/' . phpversion();
  5. $to = "myid@gmail.com";
  6. $subject = "Hi!";
  7. $body = "Hi,\n\nHow are you?";
  8. if (mail($to, $subject, $body,$headers)) {
  9.   echo("<p>Message successfully sent!</p>");
  10.  } else {
  11.   echo("<p>Message delivery failed...</p>");
  12.  }
  13. ?>
  14.  



But still i can't get it, when i try on googlemail i get the message successfully.

The Quesiton is Why exchange Server isn't getting email from website (without auth)?
usafshah's Avatar
Member
 
Join Date: Nov 2006
Posts: 107
#4: Sep 27 '07

re: php mail bounced <full mailbox>


LOL sorry my fault, infact not a fault :-) but just found that If Intelligent Mail Filtering is enable in exchange server sp2 then script like this when use to send email to exchange will be blocked at connection stage. Because exchange needs a proper way to authenticate smtp before sending email


Anyway cheers ! buddy hope this thread help some one else :D
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#5: Sep 28 '07

re: php mail bounced <full mailbox>


Thanks for sharing your findings with us. Hope this helps somebody else.

Ronald
ak1dnar's Avatar
Moderator
 
Join Date: Jan 2007
Location: Colombo
Posts: 1,440
#6: Sep 28 '07

re: php mail bounced <full mailbox>


If any of you familiar with "exchange server" Please take a look at on this thread.PHP With Exchange Server 2003
Reply