Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]mailing
darkowski
post 11.02.2009, 08:57:16
Post #1





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 28.04.2008
Skąd: Auschwitz

Ostrzeżenie: (0%)
-----


Witam
Używam CMSa phpbp i tam jest opcja mailing, chciałbym się dowiedzieć jak zrobić żeby maile które wysyłam do userów były w stylu takim jak wysyłają reklamy np. interia, albo jakieś banki. Bo te maile co ja wysyłam są takie bezpłciowe a nadodatek nie zamiast polskich znaków są jakieś kwadraty
Go to the top of the page
+Quote Post
Sky_walker
post 11.02.2009, 09:10:35
Post #2





Grupa: Zarejestrowani
Postów: 214
Pomógł: 23
Dołączył: 26.09.2005

Ostrzeżenie: (0%)
-----


"kwadraty" to problem z kodowaniem. mozliwe, że masz zainstalowaną anglojęzyczną wersję forum.
#
Co to znaczy "w takim stylu jak reklamy" ? Znaczy z obrazkami? Odpuść sobie. Wysyłanie obrazków w mailach jest wysoce niestosowne i blokowane przez większość użytkowników znających się na rzeczy. winksmiley.jpg


--------------------
Pomogłem? Kliknij poniżej.
Dzięki! :D
Go to the top of the page
+Quote Post
darkowski
post 11.02.2009, 11:40:54
Post #3





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 28.04.2008
Skąd: Auschwitz

Ostrzeżenie: (0%)
-----


Napewno mam zainstalowaną polską wersje a skoro chodzi o kodowanie to jak mam to naprawić?
Tak chodzi mi o obrazki, a dokładnie żeby chociaż logo mojej strony było w mailu
Go to the top of the page
+Quote Post
erix
post 11.02.2009, 18:22:17
Post #4





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Cytat
Bo te maile co ja wysyłam są takie bezpłciowe a nadodatek nie zamiast polskich znaków są jakieś kwadraty

Raz: kodowanie maila, dwa: masz na myśli mailing html. Ale jak zauważył ~Sky_walker, mogą być blokowane. Poza tym, musisz pamiętać o tym, aby nie śmiecić wiadomości załącznikami, filtry antyspamowe są bardzo wyczulone na tego typu maile.

Cytat
a skoro chodzi o kodowanie to jak mam to naprawić?

Znaleźć plik, który odpowiada za wysyłanie maila, sprawdzić nagłówki, poszukać na tym forum pod hasłem mail kodowanie.

Chociaż dobrze by było najpierw sprawdzić dokumentację, opcje w CMS-ie, a dopiero na końcu grzebać w źródłach.


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

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
darkowski
post 12.02.2009, 09:57:08
Post #5





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 28.04.2008
Skąd: Auschwitz

Ostrzeżenie: (0%)
-----


mam takie pliki

mailing_form.php
  1. <? global $lang, $conf, $theme_path; ?>
  2. <FORM ACTION="index.php" METHOD="POST" NAME="_form">
  3. <INPUT TYPE="HIDDEN" NAME="function" VALUE="mailing_send">
  4. <INPUT TYPE="HIDDEN" NAME="module" VALUE="mailing">
  5. <TABLE ALIGN="CENTER" WIDTH="75%" BORDER="0" CLASS="tabelka2">
  6. <TR>
  7.    <TD CLASS="row_1" ALIGN="CENTER"><?=$lang['mailing_subject']?></TD>
  8.  <TD CLASS="row_1" ALIGN="LEFT"><INPUT TYPE="TEXT" MAXLENGTH="150" NAME="subject" VALUE="" CLASS="button" SIZE="30"></TD>
  9. </TR>
  10. <TR>
  11.    <TD CLASS="row_2" ALIGN="CENTER"><?=$lang['mailing_message']?></TD>
  12.  <TD CLASS="row_2" ALIGN="LEFT"><TEXTAREA NAME="message" COLS="60" ROWS="20" CLASS="button"></TEXTAREA></TD>
  13. </TR>
  14. <TR>
  15.    <TD CLASS="row_1" ALIGN="CENTER" valign="top"><?=$lang['mailing_mailto']?></TD>
  16.  <TD CLASS="row_1" ALIGN="LEFT">
  17.  <table cellspacing="0" cellpadding="1" border="0" width="100%">
  18.  <tr>
  19.      <td class="row_1" align="left" width="16" valign="top"><input type="radio" name="how" class="radio" value="all" class="button" checked></td>
  20.      <td class="row_1" align="left"><?=$lang['mailing_all']?></td>
  21.    </tr>
  22.  <tr>
  23.    <td class="row_1" align="left" width="16" valign="top" rowspan="2"><input type="radio" name="how" class="radio" value="groups" class="button"></td>
  24.    <td class="row_1" align="left"><?=$lang['mailing_groups']?></td>
  25.  </tr>
  26.  <tr>
  27.    <td class="row_1" align="left"><SELECT NAME="groups[]" CLASS="button" multiple size="6">
  28.    {groups_list}
  29.    </SELECT></td>
  30.  </tr>
  31.  <tr>
  32.    <td class="row_1" align="left" width="16" valign="top" rowspan="2"><input type="radio" name="how" class="radio" value="users" class="button"></td>
  33.    <td class="row_1" align="left"><?=$lang['mailing_users']?></td>
  34.  </tr>
  35.  <tr>
  36.    <td class="row_1" align="left"><SELECT NAME="users[]" CLASS="button" multiple size="6">
  37.    {users_list}
  38.    </SELECT></td>
  39.  </tr>
  40.  </table>
  41.  </TD>
  42. </TR>
  43. <TR>
  44.     <TD ALIGN="CENTER" COLSPAN="2"><INPUT TYPE="SUBMIT" VALUE="<?=$lang['submit']?>" CLASS="button"></TD>
  45. </TR>
  46. <TR>
  47.     <TD HEIGHT="5"> </TD>
  48. </TR>
  49. </TABLE>
  50. </FORM>
Go to the top of the page
+Quote Post
Sky_walker
post 12.02.2009, 09:59:03
Post #6





Grupa: Zarejestrowani
Postów: 214
Pomógł: 23
Dołączył: 26.09.2005

Ostrzeżenie: (0%)
-----


To jest formularz do ktorego wprowadzasz dane, a nie plik odpowiadajacy za wysylanie maila.


--------------------
Pomogłem? Kliknij poniżej.
Dzięki! :D
Go to the top of the page
+Quote Post
darkowski
post 12.02.2009, 10:02:11
Post #7





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 28.04.2008
Skąd: Auschwitz

Ostrzeżenie: (0%)
-----


mailing.php
  1. <?php
  2. $autoload='external';
  3. function mailing_send()
  4. {
  5.  global $lang, $conf;
  6.  
  7.  if(!perms_check('admin', 'mailing'))
  8.  {
  9.    redirect('index.php?module=error&error=auth_error');
  10.    exit;
  11.  }
  12.  
  13.  $db=new dbquery;
  14.  
  15.  if(function_exists(mail))
  16.  {  
  17.    $message = read_text_rest($_POST['message']."\n\n-- -- -- -- -- -- -- --\n\n".$conf['mailing_signature']);
  18.    $subject=read_text_rest($conf['adress'].' - '.$_POST['subject']);
  19.  
  20.    if($_POST['how'] == 'all')
  21.    {
  22.      
  23.      $db->query("SELECT * FROM $conf[prefix_users]users WHERE mailing = 1 and active = 1") or $db->err(__FILE__, __LINE__);
  24.      
  25.      while($d = $db->fetch_object())
  26.      {
  27.        if(!mail($d->mail, $subject, $message, "From: $conf[mailing_from]r\n"."Reply-To: $conf[mailing_reply_to]r\n"."X-Mailer: PHP/".phpversion()))
  28.        {
  29.          redirect('index.php?module=admin&action=mailing&what=notsent');
  30.          exit;
  31.        }        
  32.      }
  33.    }
  34.    elseif($_POST['how'] == 'users')
  35.    {
  36.     for($i = 0; $i < count($_REQUEST['users']); $i++)
  37.     {
  38.        SQLvalidate($_REQUEST['users'][$i]);
  39.        
  40.         $db->query("SELECT * FROM $conf[prefix_users]users WHERE mailing = 1 and active = 1 and id = ".$_REQUEST['users'][$i]) or $db->err(__FILE__, __LINE__);
  41.         $u = $db->fetch_object();
  42.        
  43.         if(!mail($u->mail, $_POST['subject'], $message, "From: $conf[mailing_from]r\n"."Reply-To: $conf[mailing_reply_to]r\n"."X-Mailer: PHP/".phpversion()))
  44.         {
  45.           redirect('index.php?module=admin&action=mailing&what=notsent');
  46.           exit;
  47.         }    
  48.     }
  49.    }
  50.    elseif($_POST['how'] == 'groups')
  51.    {
  52.      $db2=new dbquery;
  53.      for($i = 0; $i < count($_REQUEST['groups']); $i++)
  54.     {
  55.       SQLvalidate($_REQUEST['groups'][$i]);
  56.        
  57.        $db2->query("SELECT * FROM $conf[prefix_users]users WHERE mailing = 1 and active = 1 and gid = $_REQUEST[groups][$i]") or $db->err(__FILE__, __LINE__);
  58.        while($u = $db2->fetch_object())
  59.        {
  60.          if(!mail($u->mail, $_POST['subject'], $message, "From: $conf[mailing_from]r\n"."Reply-To: $conf[mailing_reply_to]r\n"."X-Mailer: PHP/".phpversion()))
  61.          {
  62.            redirect('index.php?module=admin&action=mailing&what=notsent');
  63.            exit;
  64.          }    
  65.        }      
  66.    }
  67.    }
  68.    redirect('index.php?module=admin&action=mailing&what=sent');
  69.    exit;
  70.  }
  71.  redirect('index.php?module=admin&action=mailing&what=notsent');
  72.  exit;
  73. }
  74. ?>


mailing_external.php
  1. <?php
  2.  
  3. function lost_password()
  4. {
  5.  global $lang, $conf;
  6.  
  7.  $db=new dbquery;
  8.  
  9.  if($_POST['login'] or $_POST['email'])
  10.  {
  11.  
  12.    if($_POST['login'])
  13.     $sql="login='$_POST[login]'";
  14.    if($_POST['email'])
  15.     $sql="mail='$_POST[email]'";
  16.    
  17.    $db->query("SELECT * FROM $conf[prefix_users]users WHERE $sql") or $db->err(__FILE__, __LINE__);
  18.  
  19.   if($db->num_rows()==0)
  20.   {
  21.     redirect('index.php?module=error&error=login_error1');
  22.     exit;
  23.   }
  24.  
  25.   $d=$db->fetch_object();
  26.  
  27.   $code=md5($d->pass);
  28.   $id_=$d->id;
  29.  
  30.   $link=$conf['adres'].'index.php?module=images&function=lost_password_send&id='.$id_.'&code='.$code;
  31.    
  32.   $title=string_template($lang['lost_pass_title'], array('adress'=>$conf['adress']));
  33.   $message=string_template($lang['lost_pass_msg'], array('link'=>$link));
  34.  
  35.   if([email="!@mail($d-mail"]!@mail($d->mail[/email], $title, $message, "From: $conf[mailing_from]"))
  36.   {
  37.     redirect('index.php?module=error&error=mailing_error');
  38.      exit;
  39.   }
  40.    else
  41.   {
  42.     redirect('index.php?module=info&info=lost_pass_info1');
  43.      exit;
  44.   }
  45.  }
  46.  
  47.  redirect('index.php');
  48.  exit;          
  49. }
  50.  
  51. function lost_password_send()
  52. {
  53.  global $lang, $conf;
  54.  
  55.  SQLvalidate($_GET['id']);
  56.  
  57.  if($_GET['id'] && $_GET['code'])
  58.  {
  59.     $db->query("SELECT * FROM $conf[prefix_users]users WHERE id=$_GET[id]") or $db->err(__FILE__, __LINE__);
  60.  
  61.    if($db->num_rows()==0)
  62.    {
  63.      redirect('index.php?module=error&error=login_error1');
  64.      exit;
  65.    }
  66.  
  67.    $d=$db->fetch_object();
  68.  
  69.    if(md5($d->pass)!=$_GET['code'])
  70.    {
  71.         redirect('index.php?module=error&error=lost_pass_error1');
  72.         exit;    
  73.    }
  74.  
  75.    $time=time();
  76.    $pass_=substr($time, (strlen($time)-6), strlen($time));
  77.    $pass=md5($pass_);
  78.  
  79.    $title=string_template($lang['lost_pass_title'], array('adress'=>$conf['adress']));
  80.    $message=string_template($lang['lost_pass_send'], array('login'=>$d->login, 'pass'=>$pass_));
  81.  
  82.    if([email="!@mail($d-mail"]!@mail($d->mail[/email], $title, $message, "From: $conf[mailing_from]"))
  83.    {
  84.      redirect('index.php?module=error&error=mailing_error');
  85.       exit;
  86.    }
  87.     else
  88.    {
  89.       $db->query("UPDATE $conf[prefix_users]users SET pass='$pass' WHERE id=$_GET[id]") or $db->err(__FILE__, __LINE__);
  90.      redirect('index.php?module=info&info=lost_pass_info2');
  91.       exit;
  92.    }    
  93.  }
  94.  
  95.  redirect('index.php');
  96.  exit;    
  97. }
  98.  
  99. ?>




i jeszcze jedno maling.php

  1. <?php
  2. global $lang, $conf;
  3.  
  4. if(!perms_check('admin', 'mailing'))
  5. {
  6.  redirect('index.php?module=error&error=auth_error');
  7.  exit;
  8. }
  9.  
  10.  
  11. if($_GET['what'] == 'sent')
  12. {
  13.  $content = $lang['mailing_sent'];
  14. }
  15. elseif(!function_exists(mail) or $_GET['what'] == 'notsent')
  16. {
  17.  $content = $lang['mailing_error'];
  18. }
  19. else
  20. {
  21.  //groups list
  22.  
  23.  //adding admins
  24.  $groups_list = '<option value="3">'.groups_get_name_by_id(3).'</option>\n';
  25.  
  26.  
  27.  //adding users
  28.  $groups_list .= '<option value="2">'.groups_get_name_by_id(2).'</option>\n';
  29.  
  30.  
  31.  //adding rest
  32.  $query = "SELECT * FROM $conf[prefix_groups]groups WHERE type != -1 ORDER BY type ASC";
  33.  $result = mysql_query($query) or die(mysql_error($mysql_connect));  
  34.  
  35.  while($g = mysql_fetch_object($result))
  36.  {
  37.    $name = groups_get_name_by_id($g->id);
  38.    $groups_list .= "<option value=\"$g->id\">$name</option>\n";
  39.  }
  40.  //
  41.  
  42.  $users_list = NULL;
  43.  
  44.  //users list
  45.  $query = "SELECT * FROM $conf[prefix_users]users ORDER BY login ASC";
  46.  $result = mysql_query($query) or die(mysql_error($mysql_connect));  
  47.  
  48.  while($u = mysql_fetch_object($result))
  49.  {
  50.    $users_list .= "<option value=\"$u->id\">$u->login</option>\n";
  51.  }
  52.  //
  53.  
  54.  $content = string_template(read_file($theme_path.'admin/mailing_form.php'), array("groups_list" => $groups_list, "users_list" => $users_list));
  55. }
  56.  
  57. $content=string_template(read_file($theme_path.'middle_no_right.php'), array('theme_path' => $theme_path, 'content' => $content, 'description' => $lang['mailing_mailing']));
  58.  
  59. ?>


Ten post edytował darkowski 12.02.2009, 10:01:21
Go to the top of the page
+Quote Post
Sky_walker
post 12.02.2009, 10:23:31
Post #8





Grupa: Zarejestrowani
Postów: 214
Pomógł: 23
Dołączył: 26.09.2005

Ostrzeżenie: (0%)
-----


zamień
if(!mail($u->mail, $_POST['subject'], $message, "From: $conf[mailing_from]\r\n"."Reply-To: $conf[mailing_reply_to]\r\n"."X-Mailer: PHP/".phpversion()))
na
  1. <?php
  2. if(!mail($u->mail, $_POST['subject'], $message, "From: $conf[mailing_from]r\n"."Reply-To: $conf[mailing_reply_to]r\n"."Content-type: text/html; charset=iso-8859-2r\n"."X-Mailer: PHP/".phpversion()))
  3. ?>

?
a jak nie to iso-8859-2 na UTF-8:
  1. <?php
  2. if(!mail($u->mail, $_POST['subject'], $message, "From: $conf[mailing_from]r\n"."Reply-To: $conf[mailing_reply_to]r\n"."Content-type: text/html; charset=UTF-8r\n"."Content-Transfer-Encoding: 8bit"."X-Mailer: PHP/".phpversion()))
  3. ?>

winksmiley.jpg
(choć tutaj bardziej zgaduje niż jestem pewien)


--------------------
Pomogłem? Kliknij poniżej.
Dzięki! :D
Go to the top of the page
+Quote Post
darkowski
post 19.03.2009, 16:51:59
Post #9





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 28.04.2008
Skąd: Auschwitz

Ostrzeżenie: (0%)
-----


Działa dzięki wielkie

A kto mi podpowie jakchociaż zmienić kolor tła w wysłanym mailu lub jak zrobić żeby do każdego maila jako nagłówek był np. logo strony

Możemi ktośpodpowiedzieć co trzeba zmienić i gdzie żeby w mailingu zmienić kolor czcionki, albo na inną kurswe no i kolor tła wiadomości.



Dzięki
Go to the top of the page
+Quote Post
b4x
post 19.03.2009, 16:53:01
Post #10





Grupa: Zarejestrowani
Postów: 658
Pomógł: 95
Dołączył: 20.12.2005
Skąd: N54,35° E18,63° (Gdańsk)

Ostrzeżenie: (0%)
-----


To w treści maila robisz. winksmiley.jpg

np. <style>body { color: red; font: 14px Verdana; }</style>

Ten post edytował b4x 19.03.2009, 16:53:44


--------------------
Go to the top of the page
+Quote Post
darkowski
post 19.03.2009, 19:23:02
Post #11





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 28.04.2008
Skąd: Auschwitz

Ostrzeżenie: (0%)
-----


A właśnie nie działa tak jak mówisz bo już tak próbowałem bo jak wpisze tak jak ty mi podałeś to mail wychodzi tak:

&lt;style&gt;body { color: red; font: 14px Verdana; }&lt;/style&gt;TEŚCIK
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 4.07.2025 - 19:43