Skip to content

Instantly share code, notes, and snippets.

@outman
Created September 21, 2012 07:17
Show Gist options
  • Save outman/3760169 to your computer and use it in GitHub Desktop.
Save outman/3760169 to your computer and use it in GitHub Desktop.
phpexcel for phpmailer
// get the content
@ob_start();
$writer = PHPExcel_IOFactory::createWriter($excel, "Excel2007");
$writer->save("php://output");
$data = @ob_get_contents();
@ob_end_clean();
// set email attachment
$mail->AddStringAttachment($data, date('YmdHis') . '.xls');
@Milytin
Copy link

Milytin commented Apr 8, 2014

I try to do the same to send as string in json format, but when I receive in dojo toolkit get the string in wrong code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment