Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts

    php mail validation

    hi ,


    i am sending mail to group of customers using (php mailer)around 10,000
    Now few of the email address are not working now (around 2000)

    Now everytime i send group mail , my webhost gets 2000 bounce back mails .
    Is there mail sending scripts which first checks if email address is valid or not and then send email
    Please de-reputate me
    0o0o0o0

    Its better to rule in Hell then to serve in Heaven

  • #2
    Regular Coder
    Join Date
    Sep 2006
    Location
    Vermont, USA
    Posts
    154
    Thanks
    0
    Thanked 6 Times in 6 Posts
    My suggestion would be to flag the bounce-backs in the db and just not send to them any more instead of trying to determine if they're valid before sending.

    Look into the Bounce-to email header (or named something simliar). Then look to pipe that email address to a php script which reads stdin (to get the full email headers + body) and then have that script flag the db record associated with the to address as "inactive" or "failed" or whatever (just so you don't send them another).

    However, to answer your question directly, I'm only aware how to check the email domain for a response and then assume the email address exists... which really isn't a solution. For this, look into getmxrr and code something simlar to..

    PHP Code:
    // Clearly you could do more than this function does - I'm just giving you a little outline.
    function valid_email_address($email_address) { 
        if(
    trim($email_address) == '' || !strstr($email_address'@')) : 
            return 
    false;
        endif;

        list(
    $username$domain) = explode('@'$email_address);
        return (
    function_exists('getmxrr') && getmxrr($domain$mxhost)) || fsockopen($domain25$errno$errstr30);

    I only do this at registration time to check for a potentially invalid email (if host is no good, clearly email address isn't).
    Active PHP/MySQL application developer available for immediate work.
    syosoft.com mavieo.com - Remote Web Site Administration Suite - Reseller Ready

  • #3
    New Coder
    Join Date
    Aug 2005
    Location
    Groningen, Netherlands
    Posts
    57
    Thanks
    0
    Thanked 6 Times in 6 Posts
    You could also walk through your list of addresses, checking them for the appropriate format. I posted a function for doing that in an earlier post. The ones that validate, could be run through syosoft's code in the previous post.

    Good luck!


  •  

    Posting Permissions

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