summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzytzagoo <zytzagoo@users.noreply.github.com>2014-09-12 16:06:32 +0200
committerzytzagoo <zytzagoo@users.noreply.github.com>2014-09-12 16:06:32 +0200
commita5ffd221eb0f1ac0a3ccd5dd90cfcf97acaa8e86 (patch)
tree5b68331801a14bd601e342988fd495614787dd72
parentdb2a8cc8a324fd52a33ee729669500309671e6bf (diff)
downloadsmtp-validate-email-a5ffd221eb0f1ac0a3ccd5dd90cfcf97acaa8e86.zip
smtp-validate-email-a5ffd221eb0f1ac0a3ccd5dd90cfcf97acaa8e86.tar.gz
smtp-validate-email-a5ffd221eb0f1ac0a3ccd5dd90cfcf97acaa8e86.tar.bz2
Update README.md
-rw-r--r--README.md49
1 files changed, 26 insertions, 23 deletions
diff --git a/README.md b/README.md
index 179f53c..7d12f32 100644
--- a/README.md
+++ b/README.md
@@ -15,40 +15,43 @@ domain's SMTP server to try figuring out if the address really exists.
* Logging and debugging support
### Basic example
- <?php
+```php
+<?php
- require('smtp-validate-email.php');
+require('smtp-validate-email.php');
- $from = 'a-happy-camper@campspot.net'; // for SMTP FROM:<> command
- $email = 'someone@somewhere.net';
+$from = 'a-happy-camper@campspot.net'; // for SMTP FROM:<> command
+$email = 'someone@somewhere.net';
- $validator = new SMTP_Validate_Email($email, $from);
- $smtp_results = $validator->validate();
+$validator = new SMTP_Validate_Email($email, $from);
+$smtp_results = $validator->validate();
- var_dump($smtp_results);
+var_dump($smtp_results);
+```
### Array usage
The class supports passing an array of addresses in the constructor or to the
`validate()` method. Checking multiple addresses on the same server uses
a single connection.
+```php
+<?php
- <?php
+require('smtp-validate-email.php');
- require('smtp-validate-email.php');
+$from = 'a-happy-camper@campspot.net'; // for SMTP FROM:<> command
+$emails = array(
+ 'someone@somewhere.net',
+ 'some-other@somewhere-else.net',
+ 'someone@example.com',
+ 'someone-else@example.com'
+);
- $from = 'a-happy-camper@campspot.net'; // for SMTP FROM:<> command
- $emails = array(
- 'someone@somewhere.net',
- 'some-other@somewhere-else.net',
- 'someone@example.com',
- 'someone-else@example.com'
- );
+$validator = new SMTP_Validate_Email($emails, $from);
+$smtp_results = $validator->validate();
- $validator = new SMTP_Validate_Email($emails, $from);
- $smtp_results = $validator->validate();
+// or passing to the validate() method
+// $validator = new SMTP_Validate_Email();
+// $smtp_results = $validator->validate($emails, $from);
- // or passing to the validate() method
- // $validator = new SMTP_Validate_Email();
- // $smtp_results = $validator->validate($emails, $from);
-
- var_dump($smtp_results);
+var_dump($smtp_results);
+```