Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]PHP a mail
Forum PHP.pl > Forum > Przedszkole
viperek
Witam, otoz zaczolem sobie dzialac z PHPProbid zalozylem wlasny serwer na krasnalu i wszystko ladnie smiga dopoki sie niezarajestruje ktos na portalu i czeka na email aktywacyjny. niewiem dlaczego ale niechce wysylac emaili. Probowalem rozne emaile, na interii, o2 oraz n platnym angielskim serwisie, i dalej nic... prosilbym o pomoc.

Oto send_activation_emails.php


Kod
<?
#################################################################
## PHP Pro Bid v6.00                                                            ##
##-------------------------------------------------------------##
## Copyright ©2007 PHP Pro Software LTD. All rights reserved.    ##
##-------------------------------------------------------------##
#################################################################

session_start();

define ('IN_ADMIN', 1);
define ('IN_SITE', 1);

include_once ('../includes/global.php');

include_once ('../includes/class_fees.php');

if ($session->value('adminarea')!='Active')
{
     header_redirect('login.php');
}
else
{
     include_once ('header.php');## PHP Pro Bid v6.00 add signup fee procedure here.
     $signup_fee = new fees();
     $signup_fee->setts = &$setts;
     $signup_fee->set_fees(0);
    
     $can_send = false;## PHP Pro Bid v6.00 can send activation emails
     if ($setts['signup_settings'] == 1 && $signup_fee->fee['signup_fee'] <= 0)
     {
         $can_send = true;
     }

    
     if ($can_send)
     {
         if (isset($_POST['form_proceed']))
         {
   $sql_select_users = $db->query("SELECT u.user_id, u.name,  u.username, u.email FROM " . DB_PREFIX . "users u WHERE
                 u.active=0 AND u.mail_activated=0");
            
             while ($row_details = $db->fetch_array($sql_select_users))
             {
                 include('../language/' . $setts['site_lang'] . '/mails/register_confirm_user_notification.php');    
             }
            
             $can_send = false;
             $send_emails_msg = AMSG_ACT_EMAILS_SENT_MSG;
         }
         else
         {
             $send_emails_msg = AMSG_ACT_EMAILS_MSG;
         }
     }
     else
     {
         $send_emails_msg = AMSG_ACT_EMAILS_IMPOSSIBLE_MSG;
     }

     $template->set('can_send', $can_send);
     $template->set('send_emails_msg', $send_emails_msg);

     $template->set('header_section', AMSG_USERS_MANAGEMENT);
     $template->set('subpage_title', AMSG_REG_ACTIVATION_EMAILS);

     $template_output .= $template->process('send_activation_emails.tpl.php');

     include_once ('footer.php');

     echo $template_output;
}
?>







A tutaj send_activation_emails.tpl.php

Kod

<?
#################################################################
## PHP Pro Bid v6.00                                                            ##
##-------------------------------------------------------------##
## Copyright ©2007 PHP Pro Software LTD. All rights reserved.    ##
##-------------------------------------------------------------##
#################################################################

if ( !defined('INCLUDED') ) { die("Access Denied"); }
?>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
       <td rowspan="2"><img src="images/i_tables.gif" border="0"></td>
       <td width="100%"><img src="images/pixel.gif" height="24" width="1"></td>
       <td>&nbsp;</td>
    </tr>
    <tr>
       <td width="100%" align="right" background="images/bg_part.gif" class="head"><?=$header_section;?>
          /
          <?=$subpage_title;?></td>
       <td><img src="images/end_part.gif"></td>
    </tr>
</table>


<?=$msg_changes_saved;?>
<table width="100%" border="0" cellspacing="3" cellpadding="3" class="border">
    <form action="send_activation_emails.php" method="post">
       <tr class="c3">
          <td align="center"><b>
             <?=$subpage_title;?>
             </b></td>
       </tr>
       <tr align="center" class="c1">
          <td><?=$send_emails_msg;?></td>
       </tr>
       <? if ($can_send) { ?>
       <tr class="c3">
   <td align="center"><input name="form_proceed" type="submit"  id="form_proceed" value="<?=GMSG_PROCEED;?>"></td>
       </tr>
       <? } ?>
    </form>
</table>
jareeny
Po 1. Wsadź ten kod w bbcode, a po 2. to w ogóle sprawdziłeś czy masz odblokowaną funkcje mail() questionmark.gif
viperek
tak odblokowane bo to na wlasnym serwerze uzywajacym php 5, probowalem takze funckcje sendmail gdzie wypelnilem SMTP server oraz email adres i dalej nic
phpion
Masz wogóle zainstalowany serwer SMTP na kompie? Sprawdź krótkim skryptem testowym czy maile od Ciebie wychodzą:
  1. <?php
  2. mail('twoj@adres.pl', 'test', 'test');
  3. ?>
viperek
Cytat(phpion @ 8.11.2008, 12:05:28 ) *
Masz wogóle zainstalowany serwer SMTP na kompie? Sprawdź krótkim skryptem testowym czy maile od Ciebie wychodzą:
  1. <?php
  2. mail('twoj@adres.pl', 'test', 'test');
  3. ?>




Ok zazlozylem wlasny server SMTP oraz uruchomilem test.php.... Swietnie wiadomosc dochodzi smile.gif ale teraz jest problem wiadomosc dochodzi tylko z test.php gdy chce wyslac newsletter albo jakis aktywacyjny email nie tongue.gif I co z tym fantem zrobic tongue.gif

sorry za podwojny post, php.ini tylko definiuje Server SMTP ? czy moze byc jakis inny pink rowniez z konfiguracja SMTP ?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.