独自のライブラリを作成し、php メール関数と適切なヘッダーを使用してメールを送信できます。
function send_email($to, $from, $subject, $body, $attachment_string)
{
$filename = "receipt.pdf";
$uid = md5(uniqid(time()));
$attachment=chunk_split($attachment_string);
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
$headers .= "From: <".$from.">\r\n";
$headers .= "This is a multi-part message in MIME format.\r\n";
$headers .= "--".$uid."\r\n";
$headers .= "Content-type:text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$headers .= $body."\r\n\r\n";
$headers .= "--".$uid."\r\n";
$headers .= "Content-Type: application/pdf; name=\"".basename($filename)."\"\r\n"; // use different content types here
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Disposition: attachment; filename=\"".basename($filename)."\"\r\n\r\n";
$headers .= $attachment."\r\n\r\n";
$headers .= "--".$uid."--";
if(mail($to, $subject, $body, $headers))
{
echo "success";
}
}