Puede darse el caso de que halles alguna incompatibilidad con tu código o proyecto, recuerda probar siempre en un entorno de testing antes aplicar el código al proyecto final.
Ejemplo: enviar correo electrónico php smtp
I migrated an application to a platform without a local transport agent (MTA).I did not want to configure an MTA, so I wrote this xxmail function to replace mail() with calls to a remote SMTP server. Hopefully it is of some use.functionxxmail($to,$subject,$body,$headers)$smtp=stream_socket_client('tcp://smtp.yourmail.com:25',$eno,$estr,30);$B=8192;$c="rn";$s='[email protected]';fwrite($smtp,'helo '.$_ENV['HOSTNAME'].$c);$junk=fgets($smtp,$B);// Envelopefwrite($smtp,'mail from: '.$s.$c);$junk=fgets($smtp,$B);fwrite($smtp,'rcpt to: '.$to.$c);$junk=fgets($smtp,$B);fwrite($smtp,'data'.$c);$junk=fgets($smtp,$B);// Header fwrite($smtp,'To: '.$to.$c);if(strlen($subject))fwrite($smtp,'Subject: '.$subject.$c);if(strlen($headers))fwrite($smtp,$headers);// Must be rn (delimited)fwrite($smtp,$headers.$c);// Bodyif(strlen($body))fwrite($smtp,$body.$c);fwrite($smtp,$c.'.'.$c);$junk=fgets($smtp,$B);// Closefwrite($smtp,'quit'.$c);$junk=fgets($smtp,$B);fclose($smtp);
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)