I had a look at this PHP SMTP Email Validation and found it pretty useful.

How would I be able to post results to a MySQL database,
the info posted to the screen wont help if you have 100's of thousands of email addresses to validate.

>>>
HELO example.com
<<<
250 user.example.com Hello example.com(74.52.107.82)
>>>
MAIL FROM: <noreply@example.com>
<<<
250 sender ok <noreply@example.com>
>>
RCPT TO: <user1@Nexample.com>
<<<
250 Recipient ok <user1@example.com>
>>>
RSET

A basic MySQL db could be like this;

CREATE TABLE `tblemail` (
`id` INT(3) NULL AUTO_INCREMENT,
`txtmail` VARCHAR(100) NULL,
`response` VARCHAR(20) NULL,
`valid` VARCHAR(1) NULL,
PRIMARY KEY (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM
ROW_FORMAT=DEFAULT

Hi

You wanted to validate emails from a database then update there status? Am I correct?

Regards

You wanted to validate emails from a database then update there status? Am I correct?

Yes!
Use that script or a better one and do just that.

I am sure that based on that script, I need to look here;

if ($results[$email]) {
  //mail($email, 'Confirm Email', 'Please reply to this email to confirm', 'From:'.$sender."\r\n"); // send email

// * DO DATABASE STUFF HERE *** 

} else {
  echo 'The email addresses you entered is not valid';

// * DO DATABASE STUFF HERE *** 

}

[edit]
The part that gets me is this;

$emails = array('user@example.com', 'user2@example.com');

That would need to come from the DB with a loop and I can't ever figure out how to remove the last comma.
[/edit]

You wanted to validate emails from a database then update there status? Am I correct?

Decided to just add the emails manually, now I need to either update the DB with the response OR update the text file with the response received.

If the data isn't coming from the DB or a text file this would pose a slight problem regarding updates.

Any ideas?

Can't edit my last posts...
Have it working with a db, now to get the variables to store them in the db like ok or not ok;
I don't have a clue on how to get them?

>>>
RCPT TO: mail@example.com
<<<
250 ok
>>>
RSET
<<<
250 flushed
>>>
quit
<<<
221 mail.example.com

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.