Hi All
I would like to attach a document

stored on my network to an email.
I have a Custom button that picks up selected records and emails to an email address thats been entered by the user.
At the moment when i tell the email to pick up the field that has the file uploaded to it it only takes the file location information stored in the database..
It looks like this Document: [{"name":"\\\\192.168.44.2\\Docstore\/P0400-151-F100-009-01-A01-001-01 REV 01_uda3n5c6.pdf","usrName":"P0400-151-F100-009-01-A01-001-01 REV 01.pdf","size":150003,"type":"application\/pdf","searchStr":"P0400-151-F100-009-01-A01-001-01 REV 01.pdf,!:sStrEnd"}]
I would like it to attach the file to the email.
I have found this code snippet in the tips and tricks section of the forum
$email= "test@gmail.com" ;
$msg="File Attached";
$subject="Attached some files";
$fileArray = my_json_decode($values["Field that stores attachments"]);
$attachments = array();
$msg = "";
foreach($fileArray as $f)
{
$attachments[] = array("path" => $f["name"]);
}
$msg.= "Some field: ".$values["Some field"]."\r";
$msg.= "Some other field: ".$values["Some other field"]."\r";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, "attachments" => $attachments));
if(!$ret["mailed"])
echo $ret["message"];
This would work is i had the file stored in the database in a binary field. However unfortunatly i dont. the file is uploaded to a network drive
Can anyone offer any advice.