buenas amigos tengo un problema para adjuntar un archivo con la funcion socketmail, lo malo es que ocupo especificamente usar esta funcion para dichao proposito. Adjunto la funcion para ver si me pueden decir como adjuntar un archivo.
function socketmail($toArray, $subject, $message, $nombre, $email) {
ini_set(sendmail_from, $email);
$ipdir="172.16.30.4";
$puerto="25";
$connect = fsockopen ($ipdir, $puerto, $errno, $errstr, 30) or $mens="No se pudo conectar al servidor de correo!...";
echo $mens;
$rcv = fgets($connect, 1024);
fputs($connect, "HELO {$_SERVER['SERVER_NAME']}\r\n");
$rcv = fgets($connect, 1024);
while (list($toKey, $toValue) = each($toArray)) {
fputs($connect, "MAIL FROM:$email\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "RCPT TO:$toValue\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "DATA\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "Subject: $subject\r\n");
fputs($connect, "From: $nombre <$email>\r\n");
fputs($connect, "To: $toKey <$toValue>\r\n");
fputs($connect, "X-Sender: <[email protected]>\r\n");
fputs($connect, "Return-Path: <[email protected]>\r\n");
fputs($connect, "Errors-To: <[email protected]>\r\n");
fputs($connect, "X-Mailer: PHP\r\n");
fputs($connect, "X-Priority: 3\r\n");
fputs($connect, "Content-Type: text/html; charset=iso-8859-1\r\n");
fputs($connect, "\r\n");
fputs($connect, stripslashes($message)." \r\n");
fputs($connect, ".\r\n");
$rcv = fgets($connect, 1024);
fputs($connect, "RSET\r\n");
$rcv = fgets($connect, 1024);
}
fputs ($connect, "QUIT\r\n");
$rcv = fgets ($connect, 1024);
fclose($connect);
ini_restore(sendmail_from);
}