im having difficulty in activating the mail function within php.
I have entered the outgoing smtp address and sendmail address within php.ini.
I have created a script to send email which errors on line 4.....
I am completely baffed as to how this could all possibly work, afterall, from the tutorials that ive been through, there was nowhere which asked me to enter my email accounts password...
is there something that i am doing wrong or have overlooked?
So far i have configured
php.ini
anything else to configure to make this mail thing work?
Code: Select all
<?php
if ($BeenSubmitted) {
if ($MailTo) {
if (mail($MailTo, $Subject, $Body, "From: $MailFrom")) {
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_student.php" METHOD=POST>
Recipient's Email Address: <INPUT TYPE=TEXT NAME="MailTo" SIZE="50"><BR>
Your Email Address: <INPUT TYPE=TEXT NAME="MailFrom" 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="Submit!">
</FORM>Many thanks
-Abi