Hi.
Our host is kind of annoyed at us for using PHP's mail function on our website, but if the guest doesn't enter the e-mail correctly, then they get the bounced e-mail. They gave me this function (below) to use to set the Return-path address to the sender's e-mail, but I'm lost as to how to call the function to send the mail. So here's the function:
function mailfrom($fromaddress, $toaddress, $subject, $body, $headers) {
$fp = popen('/usr/sbin/sendmail -f'.$fromaddress.' '.$toaddress,"w");
if(!$fp) return false;
fputs($fp, "To: $toaddress\n");
fputs($fp, "Subject: $subject\n");
fputs($fp, $headers."\n\n");
fputs($fp, $body);
fputs($fp, "\n");
pclose($fp);
return true;
}
Now- How do I activate it to send mail?
Thanks!