Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z phpmailerem
john_doe
post
Post #1





Grupa: Zarejestrowani
Postów: 873
Pomógł: 25
Dołączył: 24.07.2005

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


Witajcie,

wysyłam maila za pomocą clasy phpmailer w taki oto sposób

  1. <?
  2.  
  3. include("phpmailer/class.phpmailer.php");
  4.  
  5. $list = new phpmailer();
  6.  
  7. $list->From = "kcwiklak@malfarb.pl"; // nadawca
  8. $list->FromName = "Malfarb Sp z o.o."; // nadawca
  9.  
  10.  
  11. $list->Subject = "MALFARB - Polski Producent Farb i Lakierów";
  12. $list->WordWrap = 75;
  13. $list->CharSet = "utf-8";
  14.  
  15. $list->IsHTML(true); // włączam pokazywanie treści, jako kod HTML
  16.  
  17. $list->AddEmbeddedImage("pics/upper_belt.jpg", "obrazek1"); // dodaj obrazek
  18. $list->AddEmbeddedImage("pics/bottom.jpg", "obrazek2"); // dodaj oobrazek
  19.  
  20. @MYSQL_CONNECT("localhost","malfarb","angielskina6");
  21. @mysql_select_db("malfarb");
  22. $query = "SELECT mail FROM mailing ";
  23. $result = @MYSQL_QUERY($query);
  24. while ($row = MYSQL_FETCH_ARRAY($result, MYSQL_ASSOC))
  25. {
  26.  
  27. $list->AddAddress( $row['mail'] ); // odbiorca
  28.  
  29.  
  30. $list->Body = "
  31. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  32. <html>
  33. <head>
  34. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  35. </head>
  36. <body bgcolor="#E0E7EE" style="color: #737373" >
  37.  
  38. <center>
  39.  <table border="0" width="600px" cellspacing="0" cellpadding="0">
  40. <tr>
  41. <td><img src="cid:obrazek1"></td>
  42. </tr>
  43. <tr>
  44. <td background="cid:obrazek2" height="650px" valign="top">
  45. <br /><br /><br />
  46. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Aliquam erat volutpat. Nunc auctor. Mauris pretium quam et urna.
  47. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Aliquam erat volutpat. Nunc auctor. Mauris pretium quam et urna.
  48. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Aliquam erat volutpat. Nunc auctor. Mauris pretium quam et urna.
  49. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Aliquam erat volutpat. Nunc auctor. Mauris pretium quam et urna.
  50. </td>
  51. </tr>
  52.  </table>
  53. </center> 
  54.  
  55. </body></html>
  56. ";
  57. if ( $list->Send() )
  58. {
  59. print 'Wysłanie mailingu do: <b><i>' . $row['mail'] . '</i></b><font style="color: green; font-weight: bold"> [  OK  ] </font><br />';
  60. }else print 'Wysłanie mailingu do: <b><i>' . $row['mail'] . '</i></b> <font style="color: red; font-weight: bold"> [  FAILED  ] </font><br />';
  61. }
  62.  
  63. ?>


nie wiem dlaczego i co mam źle, ale ten skrypt nie wysyła mi jednej wiadomosci do kazdego adresu z bazy tylko np do 1szego tyle ile jest wpisow w bazie
robi to generalnie tak: do 1szego adresu z bazy wysyla tyle wiadomości ile jest wpisów w bazie, do drugiego adresu tyle ile wpisów w bazie - 1 itd....
questionmark.gifquestionmark.gifquestionmark.gifquestionmark.gif?

pozdrawiam

Ten post edytował john_doe 6.08.2007, 14:36:52
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 20.08.2025 - 00:02