Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Mail z zawartością funkcji.
qraten
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 16.01.2010

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


Witam,

Chciałbym wrzucić w treść maila tabelę generowaną przez funkcję.

  1. $to = 'przyklad@prezydent.org';
  2. $subject = 'Test email';
  3. $message = "<html><head><title>ANKIETER </title></head><body>PojedynczyWynik($row);/<h1>LOL</h1></body></html>";
  4. $headers = "MIME-Versio: 1.0r\n"."Content-type: text/html; charset=UTF-8r\n";
  5. $headers .= "From: leon@probny.pl\r\nReply-To: leon@probny.pl";
  6. $mail_sent = @mail( $to, $subject, $message, $headers );
  7. echo $mail_sent ? "Mail sent" : "Mail failed";

Chciałbym wstawić w treść maila funkcję PojedynczyWynik($row);

W treści maila dostaję niestety $message:
  1. <html><head><title>ANKIETER </title></head><body>PojedynczyWynik(Array)/<h1>LOL</h1></body></html>



Czy jest na to sposób (IMG:style_emoticons/default/questionmark.gif) Proszę o info, czy przypadkiem czegoś nie namieszałem...

Ten post edytował qraten 12.02.2010, 17:19:08
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
qraten
post
Post #2





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 16.01.2010

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


Działa nieźle

  1. $to = 'leon@probny.pl';
  2. //define the subject of the email
  3. $subject = "{$row['LEKARZENAZWISKO']} Nazwisko: {$row['NAZWISKO']} Pesel: {$row['PESEL']}";
  4. //define the message to be sent. Each line should be separated with \n
  5. $message = "<html><head><title>BZIUM</title></head><body>\n";
  6. $message .= "<table width=\"50\" height=\"159\">\n";
  7. echo PojedynczyWynik($row);
  8. $wynikrob=ob_get_contents();
  9. $message .= "$wynikrob";
  10. $message .= "</table></body></html>";
  11. //define the headers we want passed. Note that they are separated with \r\n
  12. $headers = "MIME-Version: 1.0\r\n"."Content-Type: text/html; charset=UTF-8r\n";
  13. $headers .= "Content-Transfer-Encoding: 8bit";
  14. $headers .= "From: leon@probny.pl\r\nReply-To: leon@probny.pl";
  15. //send the email
  16. $mail_sent = @mail( $to, $subject, $message, $headers );
  17. //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
  18. echo $mail_sent ? "Mail sent" : "Mail failed";


Ślicznie dziękuję.
Mam tylko jeszcze jedno pytanie.

Jeśli chciałbym użyć np. include('http://jakis.pl/mail.php');

W ogóle czy można posłużyć się include ?
Jak do mail.php pobrać funkcję PojedynczyWynik($row); (IMG:style_emoticons/default/questionmark.gif)

Przy próbach wychodzi mi Fatal error: Cal to undefined function PojedynczyWynik() in /var/www/cosik.php on line 9

Ten post edytował qraten 12.02.2010, 17:33:24
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 31.12.2025 - 00:13