Foros del Web » Programando para Internet » PHP »

Correo Futuro

Estas en el tema de Correo Futuro en el foro de PHP en Foros del Web. Alguien sabe como esta creado este script alguna idea o conocimiento como crear y enviar a fecha aqui el LINk CorreoFuturo...
  #1 (permalink)  
Antiguo 25/02/2010, 21:19
 
Fecha de Ingreso: noviembre-2004
Ubicación: NULL
Mensajes: 652
Antigüedad: 19 años, 4 meses
Puntos: 6
Correo Futuro

Alguien sabe como esta creado este script alguna idea o conocimiento como crear y enviar a fecha

aqui el LINk
CorreoFuturo
  #2 (permalink)  
Antiguo 25/02/2010, 21:24
Avatar de lucasan
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: Cali - Colombia
Mensajes: 1.144
Antigüedad: 16 años, 10 meses
Puntos: 59
Respuesta: Correo Futuro

Lo mas posible es que sea un Cron Job, busca al respecto.
__________________
Plan Original Desarrollo Web
~$>sudo apt-get install -f
"Asi debería arreglarse todo en la vida"
  #3 (permalink)  
Antiguo 25/02/2010, 21:35
 
Fecha de Ingreso: noviembre-2004
Ubicación: NULL
Mensajes: 652
Antigüedad: 19 años, 4 meses
Puntos: 6
Respuesta: Correo Futuro

Puede ser algo asi como esto

Apunti

Email a futuro
  #4 (permalink)  
Antiguo 25/02/2010, 22:48
Avatar de kike00  
Fecha de Ingreso: febrero-2005
Ubicación: El Salvador
Mensajes: 180
Antigüedad: 19 años, 2 meses
Puntos: 7
Respuesta: Correo Futuro

lo que se me ocurre es: que la Informacion que pones en el formulario se guarda en una base de datos y hay algun script que se ejecuta cada hora mediante Cron Jobs.

Ese escript lo que haria es filtrar todos los registros en la BD que correspondan a la fecha y hora actual, toma esa informacion de la BD, la envia por email y posteriormente la elimina.

yo creo que asi es como funciona :P
  #5 (permalink)  
Antiguo 25/02/2010, 22:56
 
Fecha de Ingreso: noviembre-2004
Ubicación: NULL
Mensajes: 652
Antigüedad: 19 años, 4 meses
Puntos: 6
Respuesta: Correo Futuro

de casualidad tienes un ejemplo como debo partir a crear todo eso, al menos un guia o idea
  #6 (permalink)  
Antiguo 25/02/2010, 23:00
 
Fecha de Ingreso: noviembre-2004
Ubicación: NULL
Mensajes: 652
Antigüedad: 19 años, 4 meses
Puntos: 6
Respuesta: Correo Futuro

Código PHP:
<?php

/*
=====================================================
 ExpressionEngine - by pMachine
-----------------------------------------------------
 http://www.pmachine.com/
-----------------------------------------------------
 Copyright (c) 2003,2004,2005 pMachine, Inc.
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
 http://eedocs.pmachine.com/license.html
=====================================================
 File: pi.cron_email.php
-----------------------------------------------------
 Purpose: Send an email to a person or mailing list
 at a scheduled time each day
=====================================================
*/


$plugin_info = array(
                        
'pi_name'            => 'Send Email',
                        
'pi_version'        => '1.0',
                        
'pi_author'            => 'Paul Burdick',
                        
'pi_author_url'        => 'http://www.web.com/',
                        
'pi_description'    => 'Cron based email sending',
                        
'pi_usage'            => Cron_email::usage()
                    );


class 
Cron_email {


    var 
$return_data '';
    
    
    
// ----------------------------------------
    //  HTML Formatting Buttons
    // ----------------------------------------

    
function Cron_email()
    {
        global 
$TMPL$LOC$REGX$PREFS$DB;
        
        
$to         = ($TMPL->fetch_param('to') !== FALSE)   ? $TMPL->fetch_param('to')   : '';
        
$cc         = ($TMPL->fetch_param('cc') !== FALSE)   ? $TMPL->fetch_param('cc')   : '';
        
$bcc     = ($TMPL->fetch_param('bcc') !== FALSE)  ? $TMPL->fetch_param('bcc')  : '';
        
$from     = ($TMPL->fetch_param('from') !== FALSE) ? $TMPL->fetch_param('from') : $PREFS->ini('webmaster_email');
        
$subject = ($TMPL->fetch_param('subject') !== FALSE) ? $TMPL->fetch_param('subject') : '';
        
$message $TMPL->tagdata;
        
        if (
$to == '' OR $subject == '' OR $message == '') return false;
        
        if (
$TMPL->fetch_param('parse_tag') == 'on' && stristr($message'{'))
        {
            
$top    '';
            
$bottom    '';
            
            if (
preg_match("/".LD.'email_top'.RD."(.*?)".LD.SLASH.'email_top'.RD."/s"$TMPL->tagdata$matches))
            {
                
$top $matches['1'];
                
$TMPL->tagdata str_replace($matches['0'], ''$TMPL->tagdata);
            }
            
            if (
preg_match("/".LD.'email_bottom'.RD."(.*?)".LD.SLASH.'email_bottom'.RD."/s"$TMPL->tagdata$matches))
            {
                
$bottom $matches['1'];
                
$TMPL->tagdata str_replace($matches['0'], ''$TMPL->tagdata);
            }
        
            
// ----------------------------------------
            //  Fetch the weblog entry
            // ----------------------------------------
        
            
if ( ! class_exists('Weblog'))
            {
                require 
PATH_MOD.'/weblog/mod.weblog'.EXT;
            }

            
$weblog = new Weblog;        
            
            
$weblog->fetch_custom_weblog_fields();
            
$weblog->fetch_custom_member_fields();
            
$weblog->build_sql_query();
            
$weblog->query $DB->query($weblog->sql);
            
            if (
$weblog->query->num_rows == 0)
            {
                return 
false;
            }     
        
            if ( ! 
class_exists('Typography'))
            {
                require 
PATH_CORE.'core.typography'.EXT;
            }
        
            
$weblog->TYPE = new Typography;
            
$weblog->TYPE->encode_email false;
            
            
$TMPL->tagparams['rdf'] = 'off'// Turn off RDF code
            
            
$weblog->fetch_categories();
            
$weblog->parse_weblog_entries();
            
$message $top.$weblog->return_data.$bottom;
        }
        
        
$message $REGX->entities_to_ascii($message);
        
        if ( ! 
class_exists('EEmail'))
        {
            require 
PATH_CORE.'core.email'.EXT;
        }

        
$email = new EEmail;
        
$email->wordwrap false;
        
$email->initialize();
        
$email->to($to);
        
$email->cc($cc);
        
$email->bcc($bcc);
        
$email->from($from);
        
$email->subject($subject);
           
$email->message($message);
        
$email->Send();

        return 
TRUE;
    }
    
// END
    
    
    // ----------------------------------------
    //  Plugin Usage
    // ----------------------------------------

    // This function describes how the plugin is used.
    //  Make sure and use output buffering

    
function usage()
    {
        
ob_start(); 
?>

Allows you to schedule the sending of an email to the email addresses specified 
in the parameters.  The tag data (that which is between the opening and closing tag) 
will be the contents of the email's message.

As a perk, you can have the tag data parsed exactly as if it were part of 
an {exp:weblog:entries} tag.  This allows you to, say, schedule the sending of an 
email at the beginning of every day containing the most recently posted entries of that day.


=====================
Parameters
=====================

to=""          - Recipient(s) of email [required]

from=""         - Sender of email [optional, default webmaster of site]

cc=""         - CC Recipient(s) of email [required]

bcc=""         - BCC Recipient(s) of email [required]

subject=""     - Subject line of email [required]

parse_tag="" - If set to 'on' it will parse the tagdata as if it were part of a 
{exp:weblog:entries} tag.  When set to 'on' the tag will accept all of the usual
parameters for the {exp:weblog:entries} tag as well. [optional]

=====================
Pair Variables
=====================

{email_top}{/email_top} - When parse_tag is set to "on" the content between this variable pair will be removed from
the tagdata (i.e. not parsed) and placed at the top of the sent email.  Think email heading and opening statement

{email_bottom}{/email_bottom} - When parse_tag is set to "on" the content between this variable pair will be removed from
the tagdata (i.e. not parsed) and placed at the bottom of the sent email. Think signature.

=====================
EXAMPLES
=====================

{exp:cron plugin="cron_email" day="23" minute="59" to="[email protected]" subject="Daily Email"}

Hello There!

{/exp:cron}

<?php
        
        $buffer 
ob_get_contents();
    
        
ob_end_clean(); 

        return 
$buffer;
    }
    
// END
    
}
// END CLASS

?>

Etiquetas: correo, futuro
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:15.