After long time, I got this very unusual idea to make something useful Basically I got fed up with my web host not allowing mail() feature and so MAIL4EVERY1. Mail4Every1 is a simple script that would allow any one to send emails even if the webhost allows the mail() or not or even it doesnt have a mail server at all. It is simply another function (zmail()) to sustitue for the default php mail() function.
It's just simple, no rocket science included . What the script does is to use a server that has already enabled the mail() function to act as the mail server of your host.
- You call the zmail() function
- zmail() does a *hidden* AJAX call to another php script hosted in a host with mail() enabled
- The second host sends the message with the details given in the first one
Lets begin the interesting part
- mailer.php - The official script which contains the zmail() function
- A host with mail() enabled - Now you think why on the earth I would not use that host without doing all those hard stuff. The reason is many reliable web hosting providers doesn't allow the use of the mail() function as it can be easily abused. But there are plenty of free web hosting sites to help you in the task of doing it. Ex: I use zymic.com [I AM NOT TELLING ANYTHING WRONG ABOUT THIS HOST, JUST FOR THE EXPLANATION I USE IT]. I dont get the mail() function unless I give $10. I simple don't want to be paying as I cannot afford so I use another free host like freehostingcloud as the second host and use this script to send my mails.
- mail.php - This one should be there in the second host to be called from the first
- Download the zip file and extract, and you will get 3 files in the "zmail" directory. mailer.php, mail.php and jquery.js
- Upload mailer.php and jquery.js to web host from where you want to send mails.
- You need a free host that will allow to use the mail() function, I used the site freehostingcloud.com for mine. Make a new account there and upload the mail.php you found on the "zmail" directory.
- Now we need to call the zmail() function from another php script which will accept the POST data from a html form. You can find the index.php and mail2.php in the "demo" directory in the file you downloaded. Upload that to the SAME directory as before
So we will make a simple a php script, it is just as calling the normal mail() function.
- $url - The path where the php script that do the actual mailing is [in the server where mail() is allowed]
- $to - The reciever of the mail
- $from - The sender's email [NOTE That some free hosting requires that the sender mail should be registered at the control panel first]
- $name - The sender's name
- $sub - The subject of the message
- $msg - The mail content
Now to call this script a little HTML form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>#Project : Mail4Every1 ZONTEK</title> </head> <body> *****************************************<br /> #PROJECT MAIL4EVERY1<br /> *****************************************<br /> <form action="mail2.php" method="post"> <table border="0"> <tbody> <tr> <td>To :</td> <td><input type="text" name="to" /></td> </tr> <tr> <td>From :</td> <td><input name="from" type="text" /></td> </tr> <tr> <td>From Name :</td> <td><input name="name" type="text" /></td> </tr> <tr> <td>Subject :</td> <td><input name="sub" type="text" /></td> </tr> <tr> <td>Message :</td> <td><textarea cols="50" rows="15" name="msg"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" value="Send" name="send" /></td> </tr> </tbody></table> </form> </body> </html>
- Upload these to the same drectory where mailer.php is
- Now browse your zymic URL http://site.zymic.com/mailtest you will find a simple form. Put the details in there, make sure you have done the steps corectly and push the Send button. You will be redirected to the mail2.php and then a little loading like sign and then everything done!
you will recieve your mail SOON...
Thats is basically the thing, but there are some things to be put
- THIS SCRIPT IS FOR EDUCATIONAL PURPOSES AND FOR THE USAGE FOR A GOOD REASON ONLY
- PLEASE DONOT USE THIS SCRIPT FOR SPAMMING
- THIS IS COMPLETELT FREE AND OPEN, DO WHAT EVER YOU LIKE BUT DONT FORGET TO MENTION US : http://zontek.zzl.org
- PLEASE DONATE ME TO PAY FOR MY ELECTICITY BILL : (if you like to donate my paypal is email@example.com)