Broad Network

PHP Mailsend

PurePHP Sendail Program

Free to Download

Foreword: Written with Pure PHP, this module can be used to send mail from any computer that has PHP installed, in a secure way.

By: Chrysanthus Date Published: 19 Jan 2018


This is a program that enables you to send email securely.

Important politicians' email can be hacked; until you now have ransom-ware. So, you can no longer afford to take any risk. Block it!
You might have opened a social network page and saw information that was not meant for you. That is a big opening for hacking. The SMTP protocol does not provide any mechanism to prevent two or more people from sharing the same connection.
However, the free PHP Mailsend API stops two or more people from sharing the same connection. Now, block the opening (insecurity) by downloading the free PHP Mailsend API (below).

Internal Security
In writing the library, the following leaks (cheats) were sealed (prevented) as illustrated:
- In comparisons both the value and value type were taken into consideration.
- === was used instead of == where 0, '0', null, '', false or 1, -1, '1', '-1', 'php', true were concerned.
- Arguments to functions and function return values where used consistently and checked where necessary.
- Inputs from the user were validated.
- require_once() was used instead of include_once().
- Error cheking was thorough.
- Limits the possibility of PHP code being executed in the Body (message) of the email.
- Any array was used either as index array or associative array (not both).
- Any calculation that had only integers, was separated from calculation that had both integers and floats.
- The library has been written for php.ini at its default state.
- Unhelpful built-in functions, such as addslashes, were not used.
- After installation, please set all the API files as executable-only (use .htaccess if necessary).

The library is a single file module and needs a PHP program with the following variables (array) and function, as you should use them.

This includes the module (library) into the program in a secured way.

$emarr['remote_host'] = "";
Replace "" with your own, such as "" . If the domain_name has but the 8 number IP address (e.g. "1021:458:0:1234:0:567:8:1"), then use the IP address in this position instead.

$emarr['port'] = 25;
Replace 25 with your server program number such as 587 (default).

$emarr['MAIL_FROM'] = '<>';
This variable must be typed with its email address. This is the address to which an email will be sent to, by the email server if an error occurs in the transmission. It can be the same as one of the addresses in the From field.

$emarr['Recipients'] = array('','');
This array must be typed with at least one of the recipients' address - without the angle brackets.

$emarr['From'] = "'Bob Example' <>";
This variable must be typed with one or more email addresses, separated by commas, in a string. In this heading you have just one email address. It is for the person (or people) who wrote the email. It can have the MAIL_FROM address above.

$emarr['To'] = '<>';
This variable must be typed. It should be one of the recipients' addresses above.

$emarr['Cc'] = '<>';
The presence of this variable is optional. A copy of the email can be sent to the address (or addresses).

$emarr['Bcc'] = '<>';
The presence of this Blind Carbon Copy variable is optional.

$emarr['Subject'] = 'Welcoming the New Members';
This variable for the subject, must be present.

$emarr['Body'] = "something sometning sometning";
This variable, for the body of the letter, must be present. The string value can be very long.

This function must be used after the above has been typed. It sends the email to the email server (MSA, Mail Submission Agent), which sends the email to the destination. Returns true for success and false for failure. In the case of false, get the error message from the module variable, $err_msg.

Installation is easy. Just download the free Mail Send program from the following link:


It comes as a zipped directory. Unzip the directory and you will find the file (module), Mailsend.php . Copy this file into the same directory as your PHP program that has the above code. Thatís all.

Any problem or suggestion or comments you have about the program should be done at the following group. You may need to subscribe (freely) first.

Coding by Hand

Related Links

Using the PurePHP MySQL API
Pure PHP Mailsend - sendmail
More Related Links
Basics of PHP with Security Considerations
PurePerl MySQL API
Perl Mailsend



Become the Writer's Follower
Send the Writer a Message