Hello,
is there a way to restrict email-actions from private senders like gmail, hotmail, gmx eg.?
Thx!
is there a way to restrict email-actions from private senders like gmail, hotmail, gmx eg.?
Thx!
<?php
$no_email = array(
'@gmail',
'@hotmail',
. . .
);
$send_email = true;
foreach ( $no_email as $e ) {
if ( strpos($form->data['email']) !== false ) {
$send_email = false;
break;
}
}
if ( $send_email ) {
return 'send_email';
}
?>
<?php
$no_email = array(
'att.net',
'comcast.net',
'cox.net',
'earthlink.net',
'facebook.com',
'gmail.com',
'gmx.com',
'gmx.de',
'gmx.net',
'googlemail.com',
'hotmail.co.uk',
'hotmail.com',
'hotmail.de',
'hushmail.com',
'inbox.com',
'juno.com',
'live.com',
'live.de',
'mac.com',
'mail.com',
'me.com',
'msn.com',
'o2.co.uk',
'online.de',
'rocketmail.com',
'sbcglonal.net',
'sky.com',
't-online.de',
'verizon.net',
'web.de',
'yahoo.co.uk',
'yahoo.com',
'yandex.com',
'ymail.com',
'yahoo.de',
'zoho.com',
);
$send_email = true;
foreach ( $no_email as $e ) {
if ( strpos($form->data['email'] !== false ) {
$send_email = false;
break;
}
}
if ( $send_email ) {
return 'send_email';
}
?>
if ( strpos($form->data['email'] !== false ) {
:-(
if ( strpos($form->data['email']) !== false ) {
<?php
$no_email = array(
'att.net',
'comcast.net',
'cox.net',
'earthlink.net',
'facebook.com',
'gmail.com',
'gmx.com',
'gmx.de',
'gmx.net',
'googlemail.com',
'hotmail.co.uk',
'hotmail.com',
'hotmail.de',
'hushmail.com',
'inbox.com',
'juno.com',
'live.com',
'live.de',
'mac.com',
'mail.com',
'me.com',
'msn.com',
'o2.co.uk',
'online.de',
'rocketmail.com',
'sbcglonal.net',
'sky.com',
't-online.de',
'verizon.net',
'web.de',
'yahoo.co.uk',
'yahoo.com',
'yandex.com',
'ymail.com',
'yahoo.de',
'zoho.com',
);
$send_email = true;
foreach ( $no_email as $e ) {
if ( strpos($form->data['email'], $e) !== false ) { // change this line again
$send_email = false;
break;
}
}
if ( $send_email ) {
return 'send_email';
}
?>
On Submit
Check Captcha
+ on Success - leave empty
+ on Fail - Event Loop
Event Switcher
+ on no_email (new event) - show message + event loop
After the Event Switcher
Email 1
Email 2
Thanks Message
Debugger - for debugging
Adding a Debugger action(s) and debug code can help you track exactly what is happening and pin down where an error is occurring.
<?php
$no_email = array(
'att.net',
'comcast.net',
'cox.net',
'earthlink.net',
'facebook.com',
'gmail.com',
'gmx.com',
'gmx.de',
'gmx.net',
'googlemail.com',
'hotmail.co.uk',
'hotmail.com',
'hotmail.de',
'hushmail.com',
'inbox.com',
'juno.com',
'live.com',
'live.de',
'mac.com',
'mail.com',
'me.com',
'msn.com',
'o2.co.uk',
'online.de',
'rocketmail.com',
'sbcglonal.net',
'sky.com',
't-online.de',
'verizon.net',
'web.de',
'yahoo.co.uk',
'yahoo.com',
'yandex.com',
'ymail.com',
'yahoo.de',
'zoho.com',
);
$send_email = true;
foreach ( $no_email as $e ) {
if ( strpos($form->data['email'], $e) !== false ) {
$send_email = false;
break;
}
}
if ( $send_email ) {
return 'send_email';
}
?>
if ( !$send_email ) {
return 'no_email';
}
?>
At present you are calling the send_email event which does nothing.