I want to attach a pdf file that I created with TCPDF to my email.
This is how I do it:
$fileatt = $pdf->Output('file.pdf', 'E');
header("Location: mailto:someone@somepage.com?subject=my report&attachment=".$fileatt."&body=see attachment");
But I get an error message Warning: Header may not contain more than a single header
UPDATE:
Fred -ii-
suggested to use Swiftmail to get this problem work:
$fileatt = $pdf->Output('quotation.pdf', 'E');
require_once 'swiftmailer/lib/swift_required.php';
// Create the mail transport configuration
$transport = Swift_MailTransport::newInstance();
// Create the message
$message = Swift_Message::newInstance();
$message->setTo(array(
"someone@somewhere.com" => "Someone",
));
$message->setSubject("This email is sent using Swift Mailer");
$message->setBody("You're our best client ever.");
$message->setFrom("someone@somewhere.com", "Your bank");
// Send the email
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
$message->attach(
Swift_Attachment::$fileatt);
But I still cannot figure out, how to combine this with the mailto