Sending Email in PHP

PHP has made many things so easy and readymade that we can easily send email.
Few settings for sending email:
Configuration is done in php.ini file.
1) SMTP = (smtp sever name )
example :
2) sendmail_from = administrator email address
example :

echo "<h3>Sending Email in PHP</h3>";
if(isset($_POST['txtto']) && isset($_POST['txtmsg']))

if (mail($to,$sub,$msg,"From:".$frm) )
 echo "Email sent succesfully";
 echo "Email not sent succesfully";



<title>Email in PHP</title>
<form name='mailfrm' method='post'>
<table border='0'>
<tr><td>To   :</td><td><input type='text' name='txtto' size='25' /></td></tr>
<tr><td>From:</td><td><input type='text' name='txtfrom' size='25' /></td></tr>
<tr><td>Subject:</td><td><input type='text' name='txtsub' size='30' /></td></tr>
<tr><td>Message</td><td><textarea name='txtmsg' rows='5' cols='20' ></textarea></td></tr>
<tr><td><input type='submit' value='send' /></td></tr>

1 comment:

  1. Important note: from now on, I'll always visit your blog. Please don't hesitate to visit me. Let's be more than just followers...let's be faithful readers! Thanks :)

    Lovers' Shore


Thanks for visiting my Blog!

Have a Question ? Need Help in College Assignments, Need Code that is not available here? Just leave a comment & get your code instantly.

Tips to Enhance Your Blog