i have a situation where i need to send an email with attachment using clients Outloook,
<% string filePath = "http://localhost/GetPDF";%>
<a href="mailto:?subject=Report&attachment='<%: filePath %>'">Send via outlook</a>
the GetPDF action returns a pdf i.e.:
public override void ExecuteResult(ControllerContext context)
{
byte[] pdfBytes = null;
//pdf generation
....................
context.HttpContext.Response.Clear();
context.HttpContext.Response.AddHeader("Content-Type", "application/pdf");
context.HttpContext.Response.AddHeader("Content-Disposition", "attachment; filename=Report.pdf; size=" + pdfBytes.Length.ToString());
context.HttpContext.Response.Flush();
context.HttpContext.Response.BinaryWrite(pdfBytes);
context.HttpContext.Response.Flush();
context.HttpContext.Response.End();
}
but unfortunately after the send mail window opens, pdf is not attached =/
can this be fixed ?
Thank You !
There is no way to attach files using the mailto: URI scheme.