SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Provo, UT
    1 Post(s)
    0 Thread(s)

    Sending email with SMTP to bogus email accounts

    I use the following code to display an error message if there are problems while sending messages through my SMTP server:

    PHP Code:
    if (PEAR::isError($mail)) {

    $errorMessage $mail->getMessage();
    print (

    Today I put a bogus address on my domain to see what would happen. I used Here is the error I got:

    Failed to add recipient: [SMTP: Invalid response code received from server (code: 550, response: No Such User Here")]

    I tried sending the same test message to a bogus account on another domain. I tried using and the message actually went out successfully and later bounced about 5 minutes later. So why does the "No Such User Here" message only work on my own domain? If I can figure out how to do this for other domains, then I can write some code that will suspend a user's account that is generating send errors on the fly.


    Convert your dollars into silver coins.

  2. #2
    PHP Guru's Avatar
    Join Date
    Jan 2009
    0 Post(s)
    0 Thread(s)
    In the first case the bounce was generated immediately. This is not common
    Most often the bounce email bounces back after some time has passed - sometimes 5 seconds, sometimes could be hours.
    This depends on the server where you sending the message. probably has hundreds of thousands of email accounts and hundreds of smtp servers in their network, so it takes some time for them to figure out that email is bouncing.

    Generally you cannot detect bounce email from the same script that sends out an email. Detecting and processing bounced emails is actually a pretty complicated task.
    My project: Open source Q&A
    (similar to StackOverflow)
    powered by php+MongoDB
    Source on github, collaborators welcome!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts