1. What is Email Plugin?
It is a spam-protected and hack-protected email functions service plugin for IncPlugins.
2. Plugin installation
Download the latest Email Plugin release. It comes with IncPlugins Pro. Unzip it to any temporary directory.
Copy email.php to your IncPlugins directory. Add the plugin include line to the IncPlugins settings file settings.php.
3. Spam-protected email links
It uses JavaScript to protect your links. This protection allows you to protect email addresses from most spam bots.
Don’t write email addresses directly in HTML.
Use function: function email_js_link($email).
Example:
Contact us by email: <?=email_js_link('support@somedomain.com')?>
The result will be:
If you will see the page source, you will not find this email address and related signatures like mailto: and @.
4. Spam-protected and hack-protected email functions
PHP function function mail() is not safe, because it is easy ho hack over email headers. We recommend you to use our special function function email_send($to, $username, $useremail, $subject, $message, $charset = '') to send your messages over web forms.
Here are:
- $to — your email address
- $username — user full name
- $useremail — user email address
- $subject — message subject
- $message — message body
- $charset — message charset
It returns true if message was sent sucessfully, or false, if PHP function function mail() fails, hack attempt found or message contains spam signatures.
The function also recodes russian messages from Windows-1251 to KOI-8 (email encoding standard in the russian internet).
To check messages by spam the function function email_is_spam($text) is used.
Email signatures are located in variable: $email_spam_list. You can modify it for your needs.
5. Advanced user information in your emails
You can additionally receive user browser information and user IP address.
The function
function email_user_info($ass_array = false) is used.
Here $ass_array is associative array with additional parameters.
Using example:
$a = array( 'Form page referer' => $_SERVER['HTTP_REFERER'], 'Color' => 'Black' ); $message_body = $body.email_user_info($a);
The resulted $message_body will contain a text like (your browser’s information is used:
[email body] User Info--------------------------------------------- HTTP_USER_AGENT : CCBot/1.0 (+http://www.commoncrawl.org/bot.html) HTTP_ACCEPT_LANGUAGE : en-us,en;q=0.5 REMOTE_ADDR : 38.103.63.17 REMOTE_ADDR(Domain) : 38.103.63.17 FORM URL : Form Fields------------------------------------------- Form page referer : Color : Black ------------------------------------------------------

