הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   [PHP]אפשרי לשלוח HTML לאימייל? (https://hosts.co.il/forums/showthread.php?t=42753)

חיים 03-04-07 21:22

[PHP]אפשרי לשלוח HTML לאימייל?
 
תשמעו ניסיתי לשלוח HTML לאימייל יצא כל הטגים יצאו בטקסט כאילו הכל טקסט אחד ענק איך אני שולח אותם כתגים?

תודה מראש לעוזרים

dsw 03-04-07 21:23

רגע עשית בPHP או בHTML לא הבנתי?

חיים 03-04-07 21:24

שנייהם כאילו הטופס נשלח ע"י PHP אבל מה שנשלח זה תוכן שלHTML

Meir 03-04-07 21:26

תגדיר את הHEADER שיפעיל HTML

מהאתר php.net
PHP קוד:

<?php
// multiple recipients
$to  'aidan@example.com' ', '// note the comma
$to .= 'wez@example.com';

// subject
$subject 'Birthday Reminders for August';

// message
$message '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
'
;

// To send HTML mail, the Content-type header must be set
$headers  'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' "\r\n";

// Mail it
mail($to$subject$message$headers);
?>


חיים 03-04-07 21:54

תודה רבה לך


כל הזמנים הם GMT +2. הזמן כעת הוא 09:25.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ