Sending Email


     - . :

mail ("mailto", "subject", "body", "From: fromaddress");

T v v v . v . vv v . .

<?php
$page_title = "Sending Emails";

if ($BeenSubmitted) {
if ($mailto) {
if (mail($mailto, $subject, $body, "From: $mail_from")) {
print ("<b><center><font color = blue>Your Email has been successfully sent!</font></center></b>\n");
} else {
print ("<b><center><font color = red>Your Email was not successfully sent due to a system error!</font></center></b>\n");
}
} else {
print ("<b><center><font color = red>Please enter the recipient's mail to address!</font></center></b>\n");
}
}
?>
<form action="email.php" method=post>
Recipient's Email Address: <input type=text name="mailto", size="50"><br>
Your Email Address: <input type=text name="mail_from", size="50"><br>
Email Subject: <input type=text name="subject", size="80"><br>
Email Body: <textarea name="body" rows="10" cols="50">
</textarea><p>
<input type=hidden name="BeenSubmitted" value=true>
<input type=submit name="submit" value="Send!">
</form>

v!

.

<form action="email.php" method=post>
Recipient's Email Address: <input type=text name="mailto", size="50"><br>
Your Email Address: <input type=text name="mail_from", size="50"><br>
Email Subject: <input type=text name="subject", size="80"><br>
Email Body: <textarea name="body" rows="10" cols="50">
</textarea><p>
<input type=hidden name="BeenSubmitted" value=true>
<input type=submit name="submit" value="Send!">
</form>


HTML . hidden input type. v value=true . v . ?       email.php PARSER- . v hidden input type vvv v VALUE- v .

if ($BeenSubmitted) {
if ($mailto) {
if (mail($mailto, $subject, $body, "From: $mail_from")) {
print ("<b><center><font color = blue>Your Email has been successfully sent!</font></center></b>\n");
} else {
print ("<b><center><font color = red>Your Email was not successfully sent due to a system error!</font></center></b>\n");
}
} else {
print ("<b><center><font color = red>Please enter the recipient's mail to address!</font></center></b>\n");
}
}


v .

if ($BeenSubmitted) {
if ($mailto) {
if (mail($mailto, $subject, $body, "From: $mail_from")) {
print ("<b><center><font color = blue>Your Email has been successfully sent!</font></center></b>\n");
} else {
print ("<b><center><font color = red>Your Email was not successfully sent due to a system error!</font></center></b>\n");
}

} else {
print ("<b><center><font color = red>Please enter the recipient's mail to address!</font></center></b>\n");
}

}


v .

if (mail($mailto, $subject, $body, "From: $mail_from")) {
print ("<b><center><font color = blue>Your Email has been successfully sent!</font></center></b>\n");
} else {
print ("<b><center><font color = red>Your Email was not successfully sent due to a system error!</font></center></b>\n");
}


. 人v Please enter the recipient's mail to address! vvv.

vv v 㺺 HTML VALUE v . Yv v.

if ($BeenSubmitted) {
if ($mailto) {
if (mail($mailto, $subject, $body, "From: $mail_from")) {
print ("<b><center><font color = blue>Your Email has been successfully sent!</font></center></b>\n");
} else {
print ("<b><center><font color = red>Your Email was not successfully sent due to a system error!</font></center></b>\n");
}

} else {
print ("<b><center><font color = red>Please enter the recipient's mail to address!</font></center></b>\n");
}

}


v VALUE v. vvv HTML v vv . . vv v . POST METHOD- v .

HTML action = "email.php" . v. HTML <input type=hidden name="BeenSubmitted" value=true> $BeenSubmitted 뺺 .

.

vv v . v v v v vvv .