我试图在附件中发送带有csv的电子邮件,但是当我使用此代码时不发送。
$origemPortal = array("Portal Loja - Área Loja","Portal Loja - Área Cliente");
foreach ($returnData as $row)
{
//$iop=$row["OrigemPortal"];
$op = $origemPortal[$row['OrigemPortal']];
//logText($op);
$final_array = array($row['TicketNumber'],
$row['OwnerIdName'],
$row['SubjectIdName'],
$row['ArvoreAssunto'],
$row['cartaoquefezpedido'],
$row['CustomerIdName'],
$row['CreatedOn'],
$op,//without this send email
$row['Description']
);
fputcsv($file, $final_array,';');
}
logText("<a href=".$fileName.">File created on ".$fileName."</a>");
fclose($file);
mail_attachment($name_csv,$fileDir,"email@email.pt","email@email.pt","email","email@email.pt",$name,$name);
如果我发送电子邮件,请$op
$final_array
发送电子邮件。
如何使用$op
发送电子邮件?