Avatar billede henriktha Nybegynder
10. februar 2004 - 09:38 Der er 4 kommentarer og
1 løsning

Design virker ikke når det sendes med mail()

Jeg har dette design, men når jeg sender det er nogle tegn kørt fra hinanden så et billede der feks hedder: header_title.gif bliver til he ader_title.gif ???

Designet er her:
$design = "<style>.centertable { BORDER-RIGHT: #798ccc 1px solid; BORDER-LEFT: #798ccc 1px solid; BACKGROUND-COLOR: #d2dbf5 }BODY { BACKGROUND: #f5f7fc; MARGIN: 0px; COLOR: #000000 }.templateinfobox { FONT-SIZE: 10px; BACKGROUND: #e4eafc; FONT-FAMILY: Verdana,Helvetica } TD.contentBoxHeading { FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #534f4d; PADDING-TOP: 5px; FONT-FAMILY: Verdana, Arial, sans-serif }TD.main { FONT-SIZE: 11px; LINE-HEIGHT: 1.5; FONT-FAMILY: Verdana, Arial, sans-serif } </style> </HEAD> <BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 marginheight=0 marginwidth=0><!-- header //--> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY> <TR> <TD> <TABLE cellSpacing=0 cellPadding=0 width=776 align=center border=0> <TBODY> <TR> <TD> <TABLE align=center width=100% border=0> <TBODY> <TR> <TD> <DIV align=center><BR> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY> <TR> <TD width=500><IMG height=73 src=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/header_title.gif width=421></TD> <TD width=100% background=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/header_background.gif height=73> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY> <TR class=header> <TD class=contentBoxHeading vAlign=middle align=center height=30>" . $hoved . " </TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY></TBODY></TABLE></TD> <TD><IMG height=73 src=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/header_right.gif width=80></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY> <TR> <TD width=345><IMG height=23 src=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/slogan.gif width=345></TD> <TD width=100% background=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/slogan_middle.gif></TD><TD width=1 bgColor=#798ccc><IMG height=1 src=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/Pixel.gif width=1></TD></TR></TBODY></TABLE></DIV><!-- header_eof //--><!-- header_eof //--><!-- body //--> <TABLE class=centertable cellSpacing=0 cellPadding=10 width=100% bgColor=#798ccc border=0> <TBODY> <TR><!-- content //--> <TD vAlign=top width=100%> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0><TBODY><TR> <TD> <TABLE cellSpacing=0 cellPadding=2 width=100% border=0><!-- INDHOLD START--><!--Lango Added for Template MOD: BOF--><tr><td> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td height=14><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right_left.gif' border=0 width=23 height=43></td><td valign=top align=center background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/background.gif' width=100%  class=contentBoxHeading>" . $overskrift . "</td><td height=14 nowrap>          <img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right.gif' border=0 width=23 height=43></td></tr></table><table border=0 width=100% cellspacing=0 cellpadding=0 class=templateinfoBox><tr><td align=left width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif' border=0 width=5 height=10></td><td><table border=0 width=100% cellspacing=0 cellpadding=3 class=infoBoxContents><tr><td class=main><table border=0 cellspacing=0 cellpadding=2 align=right width=100% style=border-collapse: collapse bordercolor=#111111><tr><!-- Content: BOF --><td valign=top><!-- Kunde: BOF //--> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td height=14><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right_left.gif' border=0 width=23 height=43></td><td valign=top align=center background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/background.gif' width=100%  class=contentBoxHeading>Kunde Oplysninger:</td><td height=14 nowrap><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right.gif' border=0 width=23 height=43></td>  </tr> </table> <table border=0 width=100% cellspacing=0 cellpadding=0 class=templateinfoBox>  <tr> <td align=left width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif' width=5 height=1></td><td><table border=0 width=100% cellspacing=0 cellpadding=0 class=infoBoxContents><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr><tr><td class=main>" . $kundebox . "</td></tr><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr></table></td><td width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif' width=5 height=1></td></tr> </table> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td class=infoBoxfooter><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_left.gif' border=0 width=22 height=24></td><td background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_middle.gif' width=100% ><img src='images/pixel_trans.gif' border=0 width=100% height=1></td><td nowrap><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_right.gif' border=0 width=22 height=24></td> </tr> </table><!-- Kunde: EOF //--></td><td valign=top><!-- Levering: BOF //--><table border=0 width=100% cellspacing=0 cellpadding=0><tr><td height=14><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right_left.gif' border=0 width=23 height=43></td><td valign=top align=center background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/background.gif' width=100%  class=contentBoxHeading>Leverings Adresse:</td><td height=14 nowrap><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right.gif' border=0  width=23 height=43></td></tr></table><table border=0 width=100% cellspacing=0 cellpadding=0 class=templateinfoBox><tr><td align=left width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif' width=5 height=1></td><td><table border=0 width=100% cellspacing=0 cellpadding=0 class=infoBoxContents><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr><tr><td class=main>" . $leveringsbox . "</td></tr><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr></table> </td><td width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif' width=5 height=1></td></tr></table> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td class=infoBoxfooter><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_left.gif' border=0 width=22 height=24></td><td background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_middle.gif' width=100% ><img src='images/pixel_trans.gif' border=0 width=100% height=1></td><td  nowrap><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_right.gif' border=0 width=22 height=24></td>  </tr> </table>  <!-- Levering: EOF //--></tr></td><tr><td colspan=2><br><!-- Varer: BOF //--> <table border=0 width=100% cellspacing=0 cellpadding=0> <tr><td height=14><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right_left.gif' border=0 width=23 height=43></td><td valign=top align=center background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/background.gif' width=100%  class=contentBoxHeading>Bestilte varer:</td><td height=14 nowrap><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right.gif' border=0 width=23 height=43></td></tr></table> <table border=0 width=100% cellspacing=0 cellpadding=0 class=templateinfoBox><tr><td align=left width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif' width=5 height=1></td><td><table border=0 width=100% cellspacing=0 cellpadding=0 class=infoBoxContents><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr><tr><td class=main>" . $varebox . "</td></tr><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr></table> </td><td width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif' width=5 height=1></td></tr> </table> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td class=infoBoxfooter>                      <img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_left.gif' border=0 width=22 height=24></td><td background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_middle.gif' width=100% ><img src='images/pixel_trans.gif' border=0 width=100% height=1></td><td  nowrap>        <img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_right.gif' border=0 width=22 height=24></td>  </tr> </table><!-- Varer: EOF //--></td></tr><tr><td colspan=2><br><!-- Betaling: BOF //--> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td height=14><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right_left.gif' border=0 width=23 height=43></td><td valign=top align=center background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/background.gif' width=100%  class=contentBoxHeading>Betalings måde: <font color=#FF0000>" . $payment_class->title . "</font></td><td height=14 nowrap>                                <img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/corner_right.gif' border=0 width=23 height=43></td>  </tr> </table> <table border=0 width=100% cellspacing=0 cellpadding=0 class=templateinfoBox><tr><td align=left width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_l.gif' width=5 height=1></td><td><table border=0 width=100% cellspacing=0 cellpadding=0 class=infoBoxContents><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr><tr><td class=main>" . $betalingsbox . "</td></tr><tr><td><img src='images/pixel_trans.gif' border=0 width=100% height=1></td></tr></table></td><td width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif' width=5 height=1></td></tr> </table> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td class=infoBoxfooter><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_left.gif' border=0 width=22 height=24></td><td background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_middle.gif' width=100% ><img src='images/pixel_trans.gif' border=0 width=100% height=1></td><td nowrap>            <img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/infobox_footer_right.gif' border=0 width=22 height=24></td>  </tr> </table><!-- Betaling: EOF //--><!-- CONTENT: EOF --><!--Lango Added for Template MOD: BOF--></table></td></tr></table></td><td align=right width=5 background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif'><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/box_bg_r.gif' border=0 width=5 height=10></td></tr></table> <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td class=infoBoxfooter>                                  <img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/center_footer_left.gif' border=0 width=25 height=32></td>                                                            <td background='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/center_footer_middle.gif' width=100% class=contentBoxHeading>                        <img src='images/pixel_trans.gif' border=0 width=100% height=1>" . $footer . "</td>        <td nowrap><img src='" . HTTP_SERVER . DIR_WS_CATALOG . "mail/center_footer_right.gif' border=0 width=25 height=32></td>  </tr> </table>      </td></tr><!--Lango Added for Template MOD: EOF--><!-- INDHOLD SLUT--></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD><!-- content_eof //--></TR></TBODY></TABLE><!-- body_eof //--><!-- footer //--><TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY> <TR> <TD width=100% bgColor=#d2dbf5> <DIV align=center><FONT class=content></FONT></DIV></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=100% border=0> <TBODY> <TR> <TD width=75 height=71><IMG height=71 src=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/footer_left_b.gif width=75></TD> <TD class=smallText align=middle width=100% background=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/footer_middle.gif height=10><i>Med venlig hilsen</i><br><b>H.K. Data Online</b><br><A HREF=mailto:salg@hkdata.dk>salg@hkdata.dk</A></TD> <TD width=75 height=71><IMG height=71 src=" . HTTP_SERVER . DIR_WS_CATALOG . "mail/footer_right_b.gif width=75></TD></TR></TBODY></TABLE><!-- footer_eof //--><BR></TR></TBODY></TABLE></TR></TBODY></TABLE></TR></TBODY></TABLE>";

Jeg sender det med denne kode:
$headers ="MIME-Version: 1.0\r\n";
    $headers .= "X-Priority: 1\r\n";
    $headers .= "X-MSMail-Priority: High\r\n";
    $headers .= "X-Mailer: H.K. Data Online\r\n";
    $headers .= "From: H.K. Data Online <hkdata@hkdata.dk>\r\n";
    $headers .= "Content-Type: text/html;\n  charset=iso-8859-1\r\n";
            mail('henriktha@hotmail.com','Emne',nl2br($design), $headers);

Håber nogen kan finde fejlen :-(
Avatar billede esoulman Nybegynder
10. februar 2004 - 10:03 #1
Regner du selv med nogen kan finde ud af det??
Avatar billede henriktha Nybegynder
10. februar 2004 - 10:47 #2
Nej... ved godt det er svært, men det er sku den eneste måde at gøre det på !!
Avatar billede esoulman Nybegynder
10. februar 2004 - 10:49 #3
Det er klart du har nogle linieskift som er umulige, men vi har ikke en jordisk chance for at sortere i din kode..
Avatar billede henriktha Nybegynder
10. februar 2004 - 10:55 #4
Man kan da ikke sætte det i en variabel med alle de linieskift der skal til for at det ser pænt ud ???
Avatar billede henriktha Nybegynder
10. februar 2004 - 12:02 #5
Hmm... fandt så selv ud af at man skal sende med
mail('henriktha@hotmail.com','Emne',wordwrap(nl2br($design)), $headers);

Nu virker det fint.

Men må da give ret i at koden er meget forvirrende. modtager s'følig gerne forslag til hvordan det kan laves istedet !!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester