What I have done now is added a file upload box on the form and want to be able to add this uploaded file as an attachment to the email.
I need to either get the code for adding the attachment to the email or need pointers on how to get started.
Any help would be greatly appreciated.
- Code: Select all
//********** Send email with new data ************
$email="test@test.com";
$from="admin@test.com";
$msg="";
$subject="New data record";
foreach($values as $field=>$value)
{
if(!IsBinaryType(GetFieldType($field)))
$msg.= $field." : ".$value."\r\n";
}
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
//********** Send email with new data ************
$email=$values["*******_Email"];
$from=$values["*******_Email"];
$cc="*******@**************.com";
$link = mysql_connect("www.**********.com", "********", "*********");
mysql_select_db("r******t_m*g", $link);
$result = mysql_query("SELECT * FROM meetingtooldata", $link);
$rows = mysql_num_rows($result);
$lastID=$rows + 1;
//$lastID=mysql_query($rows) + 1;
$msg="If you have any questions, please contact ***** ********* at ******@***************.com or by phone at +44 (0)**** ******.\n\nMeeting ID: $lastID.\n";
$subject="Meeting Request ID ".$lastID.", ".$values["Operator"].", ".$values["Target1_Contact_Surname"];
foreach($values as $field=>$value)
{
if(!IsBinaryType(GetFieldType($field)))
$msg.= $field." : ".$value."\r\n";
}
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from' => $from, 'cc' => $cc));
if(!$ret["mailed"])
echo $ret["message"];
return true;

