Well i was jus working on a bit of php for my site and i liked the code part of it. Just not to forget i thought i’l put those esential chunk of code here so that i can always get them back whenever i want.
well you call it tutorial or anything this is just a code to send a mail to any mailbox form your personalised form like this one on the site that i’m developing.
Well it is always better to start with an example. Click here to see one
Well to simplify all the from address,to address,message let me just give u the single line code in php to send a mail. it goes this way as below
mail(“firstname.lastname@example.org”, “subject”, “this is the actual mesasge that’s sent”,”header”);
The above code will send a mail to the given address but will send the address of sender as “email@example.com” the following code below will asign those values to make it look as if it came from a particular email id.
$email=”firstname.lastname@example.org”; (to address)
$message2 .= ”
This is the actual message that’l be sent
$headers2 .= “From: email@example.com\n”;(from address to be displayed ***)
$sub2.=”This will be the subject”;
mail($email, $sub2, $message2, $headers2);
When you copy the above as such the quotes donot come properly!! u must manually replace all properly , better download from the link below!!
You find it difficult to copy paste and test? well download it hereWell now the fun part. Is your college principals email id something like “firstname.lastname@example.org“??? and your class teachers’s E-mail something like “email@example.com“??? heya, why not send a mail to your proff from the principal? don mind uh.
Note: Any suggestions here is just an idea for fun. no legal issues can be brought upon me for anything that is suggested in this site. Thankyou 🙂