SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    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 (
    "<p>$errorMessage</p>");

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

    Failed to add recipient: xyz@mydomain.com [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 xyz24601@verizon.com 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.

    Thanks!

    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    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. verizon.com 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!


Bookmarks

Posting Permissions

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