Well i have designed one email builder, By which you can send mail to anyone on behalf of anyone’s id. (This is for the education purpose only ). It’s not much complicated,you just need to pass four arguments to the mail() function. But you can not run it into your local server. You have to host that php script to any online hosting service. You can get any free hosting service online and can check your email script. We have hosted our tool online. I will give the link soon.
Script for fake php Email sender
<?php if(isset($_POST['to'])&&isset($_POST['sub'])&&isset($_POST['body'])&&isset($_POST['myid'])) { $to=$_POST['to']; $sub=$_POST['sub']; $body=$_POST['body']; $myid=$_POST['myid']; { if(!empty($to)&&!empty($sub)&&!empty($body)&&!empty($myid)) { if(mail($to,$sub,$body,$myid)) { echo "Done!"; } } else { echo "fill again"; } } } ?> <form action="mail.php" method="POST"> <Strong>TO</strong> <br> <input type="text" name="to"> <br> <strong>Subject</strong> <br> <input type="text" name="sub"> <br> <Strong>Body:</strong> <br> <textarea rows='6' cols='30' name="body"></textarea> <br> <strong>From:</Strong> <br> <input type="text" name="myid"> <br> <br> <input type="Submit" value="Submit"> <br> </form>
Logic of the fake php mail sender
Well firstly we created one mail box form which have To,Subject,Body,From elements. We simply use the POST method to get that value directly in php script. Then we first set the values to the particular variables. After that we have checked that is it empty or not, And if it’s not empty then we passed the four element in a rightly manner to the mail() function. It’s over. You can check the working of mail function by simple echo statement. That’s it, You have done it ! Try this script
Output : Live demo of email sender
Aha it’s not finished yet. Do you want to see the live demo for php fake email sender. Here it is
Well we have created this for fun. It’s for your idea about how it’s work.
How to host your php files ?
Well you have to go for hosting. There is one free hosting which i use for testing my works. It’s 000webhost . It’s pretty good because it’s free. You just have to sign up there and then by going to file manager section ,you can easily upload your scripts and check it .
I hope you all like this amazing php tutorial for fake email sender. Keep visiting us and keep sharing. Like our fb page. Happy coding .