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

php mail bounced <full mailbox>

P: 104
i'm using php mail (running on windows 2003 server <built-in smtp> ) to send email to 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\ p on line 5

Message delivery failed...

here is the script that i used;

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $to = "";
  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
Sep 26 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 2.5K+
P: 4,258
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.

Sep 27 '07 #2

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

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $headers = 'From:' . "\r\n" .
  3.     'Reply-To:' . "\r\n" .
  4.     'X-Mailer: PHP/' . phpversion();
  5. $to = "";
  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. ?>

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)?
Sep 27 '07 #3

P: 104
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
Sep 27 '07 #4

Expert 2.5K+
P: 4,258
Thanks for sharing your findings with us. Hope this helps somebody else.

Sep 28 '07 #5

Expert 100+
P: 1,584
If any of you familiar with "exchange server" Please take a look at on this thread.PHP With Exchange Server 2003
Sep 28 '07 #6

Post your reply

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