Here's how you can construct an email and send it from your PHP page rather than write a script to run in FileMaker. Some things to note:
- Your web server must be configured to allow sending emails. Talk to your server admin about that.
- $emailAddress can be a single email address or several email addresses separated by commas.
- From and Reply-To are not parameters but rather optional values tossed in the $headers parameter. CC and BCC go here as well. Here's a better example.
- Create line breaks with \n.
$to = $emailAddress;
$subject = "Ticket ".$record->getField('_kprt_Ticket').": ".$record->
getField('rt_Title');
$message = "Do not reply to this e-mail. Track your ticket online: \n";
$message = $message."https://gpssecure.umn.edu/support/ticket.php?id=".$record->
getField('_kprt_Ticket')."\n\n";
$message = $message."We received your support ticket.";
$headers = "From: gpstech@umn.edu\n";
$fifth = "gpstech@umn.edu";
mail( $to, $subject, $message, $headers, $fifth );
In our environment, the mail command will not work without a fifth parameter which is an email address. Unfortunately, this address gets a copy of every email sent using this routine. Plan accordingly.