Added a function smtp_validate_addresses($fromAddress = FALSE, $toAddresses = array()) to validate mail addresses via stmp RCPT TO:<$toADDRESS>

Some mail addresses are not accepted by smtp, so if sometimes we need to validate them before really send mails.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rogical’s picture

FileSize
3.21 KB

Instead of throwing an scare exception, just return the error directly.

rogical’s picture

mgifford’s picture

This still applies nicely (one year after you submitted it).

How do we test this patch? I don't presently need this functionality myself, but can see how it could be useful.

DamienMcKenna’s picture

FileSize
3.19 KB

Rerolled, and I removed the unnecessary changes from PHPMailer->SmtpConnect().

Anonymous’s picture

Looks good to me. I rolled the patch and it applied perfect. Seems legit to me. Let me know if you want to to test this one further. I am going to work on another one on the list.

jordanpagewhite’s picture

Looks good. I think I caught two typos. Check the interdiff.

Anonymous’s picture

FileSize
815 bytes

I see your two typos and raise you one typo.

- return t('The from mail address: !fromAddress is not accpted by the SMTP server.', array('!fromAddress' => $fromAddress));

to

- return t('The from mail address: !fromAddress is not accepted by the SMTP server.', array('!fromAddress' => $fromAddress));

Anonymous’s picture

jordanpagewhite’s picture

@alex_drupal_dev Hmm. The only difference that I can see between my interdiff and your interdiff is that yours has the correct spelling of "accepted" in the "-" line of the second edit. Did you generate this yourself or did you just edit my interdiff? If you generated it, I think we were working from different versions of the module. If you just edited my interdiff, you can read how to generate an interdiff here https://www.drupal.org/documentation/git/interdiff

DamienMcKenna’s picture

The interdiff in #7 is redundant and can be ignored. +1 for the patch in #6.

Anonymous’s picture

LOL. Just an edit for the typo. Thanks for the link I will definitely use it. :) Just keeping things fun :) I appreciate the link I will practice creating some later tonight :)

wundo’s picture

Status: Needs review » Closed (outdated)

Closing very old (dead) issues, if you think this is still relevant please re-open.