Ver Mensaje Individual
  #15 (permalink)  
Antiguo 29/09/2003, 15:26
Avatar de nuevo
nuevo
 
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 21 años
Puntos: 2
Código PHP:
/*************** Envio simple via funcion mail()**************************/
$a      "Asunto";
$d      "[email protected]";
$m      "Mensaje";
$r      "[email protected]";
$mail   = new email($a,$d,$m,$r);
$mail->enviar();
echo 
$mail->errores();//Si exisiten errores los mostrara
echo $mail->enviado();//Muestra un mensaje al enviar el mail


/*************** Envio multiple via funcion mail()**************************/
$a      = array("Asunto","Asunto2");
$d      = array("[email protected]","[email protected]");
$m      = array("Mensaje","Mensaje2");
$r      = array("[email protected]","[email protected]");
$mail   = new email($a,$d,$m,$r);
$mail->enviar();
echo 
$mail->errores();//Si exisiten errores los mostrara
echo $mail->enviado();//Muestra un mensaje al enviar el mail


/*************** Envio simple via sockets    **************************/
$a      "Asunto";
$d      "[email protected]";
$m      "Mensaje";
$r      "[email protected]";
$server "169.254.62.112";//Ip o nombre, o direccion del servidor SMTP
$port   "25";//El puerto a usar
$mail   = new email($a,$d,$m,$r);
$mail->smtp($server,$port);
//$mail->smtp($server,$port); En caso de no existir login
echo $mail->errores();//Si exisiten errores los mostrara
echo $mail->enviado();//Muestra un mensaje al enviar el mail


/*************** Envio multiple via sockets    **************************/
$a      = array("Asunto","Asunto2");
$d      = array("[email protected]","[email protected]");
$m      = array("Mensaje","Mensaje2");
$r      = array("[email protected]","[email protected]");
$server "169.254.62.112";//Ip o nombre, o direccion del servidor SMTP
$port   "25";//El puerto a usar
$mail   = new email($a,$d,$m,$r);
$mail->smtp($server,$port);
//$mail->smtp($server,$port); En caso de no existir login
echo $mail->errores();//Si exisiten errores los mostrara
echo $mail->enviado();//Muestra un mensaje al enviar el mail 
---------------------------------------------------------------

y ahora una explicacion con un formulario de como usar la clase...

---------------------------------------------------------------

Código PHP:
<html>

    <head>
        <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
        <meta name="generator" content="Maguma Studio Profesional v.1.1.0.p1">
        <title>Formulario de envio de email/s</title>

<style>
BODY {

  scrollbar-face-color: DarkGray;
  scrollbar-shadow-color: DimGray;
  scrollbar-highlight-color: DimGray;
  scrollbar-3dlight-color: #CCCCCC;
  scrollbar-darkshadow-color: black;
  scrollbar-track-color: DimGray;
  scrollbar-arrow-color: Yellow;

.txt, BODY, SELECT, INPUT, TH, TD, DIV { font-family: Verdana; font-size: 10px; color: Black; text-decoration:none}
.boton { font-family:Verdana; font-size: 9pt; color: Red; background-color: White; border-color: Black ; border-top-width: 1pix; border-right-width: 1pix; border-bottom-width: 1pix; border-left-width: 1pix}
}
</style>
        
    </head>

<body bgcolor="#ffffff">

            <form action="formulario.php?accion=envia_email" method="post" enctype="multipart/form-data">

                <div align="center">

                    <table border="0" cellspacing="0" cellpadding="0">

                        <tr height="1">
                            <td colspan="4" bgcolor="maroon" width="302" height="1"></td>
                        </tr>
                        <tr>
                            <td rowspan="4" bgcolor="maroon" width="1"></td>
                        <td width="150"><font face="Verdana" size=2>EMAL REMITE</td>
                        <td width="150"><input type="text" name="remite" size="50" class="boton"></td>
                               <td rowspan="4" bgcolor="maroon" width="1"></td>
                        </tr>
                        <tr>
                        <td width="150"><font face="Verdana" size=2>PARA QUIEN</td>
                        <td width="150"><input type="text" name="para_q" size="50" class="boton"></td>
                        </tr>
                        <tr>
                        <td width="150"><font face="Verdana" size=2>ASUNTO DEL EMAIL</td>
                        <td width="150"><input type="text" name="asunto" size="70" class="boton"></td>
                        </tr>
                        <tr>
                        <td colspan="2" align="center" valign="middle" width="878"><font face="Verdana" size=2>TEXTO DEL EMAIL<br>
                            <textarea name="mensaje" rows="15" cols="92" class="boton"></textarea><br><br></td>
                    </tr>
                        <tr height="1">
                            <td colspan="4" bgcolor="maroon" width="302" height="1"></td>
                        </tr>

                    </table>
                <br>
                <input name="envia_form" type="submit" value="Aceptar y Enviar" class="boton"></div>

            </form>

<?php

if ($_GET['accion']=="envia_email"){

require (
"class.mail.inc.php");// llamamos a la clsse.

/*************** Envio simple via funcion mail()**************************/

$a      $_POST['asunto'];
$d      $_POST['para_q'];
$m      $_POST['mensaje'];
$r      $_POST['remite'];
$mail   = new email($a,$d,$m,$r);
$mail->enviar();
echo 
"<font face=Verdana size=2 color=Red><center>".$mail->errores();//Si exisiten errores los mostrara
echo "<font face=Verdana size=2 color=Black><center>".$mail->enviado();//Muestra un mensaje al enviar el mail

/*************** Envio simple via funcion mail()**************************/

echo "<META HTTP-EQUIV=Refresh CONTENT=4;URL=formulario.php>en 4 segundos redireccion...";//volvemos al formulario

}

?>
        </body>
</html>

espero que te sirva--- y alguno mas tb....;)

__________________
3w.valenciadjs.com
3w.laislatv.com

Última edición por nuevo; 29/09/2003 a las 16:25