Is it possible to assign $msgArray
as a last element of the array which is used in curl
foreach( $attachmentsArray as $att )
{
$msgArray["attachment[$x]"] = curl_file_create( $att );
$x ++;
}
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'from' => 'Open <test@gmail.com>',
'to' => $email,
'subject' => $subject,
'html' => $msg
));