2012-12-07 3 views
0

그래, 내 문제는 두 개의 열이 필요하다. 나는 현재 학교 교장과 다른 사람들의 제목과 왼쪽에있는 그들의 이름에 관한 정보를 오른쪽에있는 실제 편지와 함께 원합니다. 그러나 모든 사람들의 제목과 이름이 왼쪽 대신 문자 위에 표시됩니다. 누군가가 내 코드를 살펴보고 내가 무엇을 놓쳤는 지 말할 수 있는지 궁금합니다. 나는 아마 벙어리 문법 오류라고 생각하거나 라인을 선언하는 것을 잊어 버렸지 만 나는 그것을 볼 수 없다.HTML과 PHP, 두 개의 열이있는 HTML 전자 메일 만들기

감사

브라우저에서로드하는 경우
These are the headers: 
$headers .= "MIME-Version: 1.0\r\n"; 
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 

And this is the message: 

$message = " 

<HTML> 
<HEAD> 

<STYLE type=\"text/css\"> 
body {margin-top: 0px;margin-left: 0px;} 
#page_1 {position:relative; overflow: hidden;margin: 169px 0px 121px 34px;padding: 0px;border: none;width: 782px;} 
#page_1 #id_1 {float:left;border:none;margin: 98px 0px 0px 0px;padding: 0px;border:none;width: 182px;overflow: hidden;} 
#page_1 #id_2 {float:left;border:none;margin: 0px 0px 0px 0px;padding: 0px;border:none;width: 600px;overflow: hidden;} 
.ft0{font: bold 13px 'Times New Roman';text-decoration: underline;color: #47744c;line-height: 15px;} 
.ft1{font: bold 12px 'Times New Roman';text-decoration: underline;color: #47744c;line-height: 14px;} 
.ft2{font: bold 12px 'Times New Roman';color: #47744c;line-height: 15px;} 
.ft3{font: bold 12px 'Times New Roman';text-decoration: underline;color: #47744c;line-height: 13px;} 
.ft4{font: italic bold 12px 'Times New Roman';color: #47744c;line-height: 14px;} 
.ft5{font: italic bold 12px 'Times New Roman';color: #47744c;line-height: 15px;} 
.ft6{font: 16px 'Times New Roman';line-height: 19px;} 
.ft7{font: italic 12px 'Times New Roman';line-height: 15px;} 
.ft8{font: 15px 'Arial';line-height: 17px;} 

.p0{text-align: left;margin-top: 0px;margin-bottom: 0px;} 
.p1{text-align: left;margin-top: 13px;margin-bottom: 0px;} 
.p2{text-align: left;margin-top: 1px;margin-bottom: 0px;} 
.p3{text-align: left;margin-top: 12px;margin-bottom: 0px;} 
.p4{text-align: left;margin-top: 11px;margin-bottom: 0px;} 
.p5{text-align: left;margin-top: 2px;margin-bottom: 0px;} 
.p6{text-align: left;margin-top: 25px;margin-bottom: 0px;} 
.p7{text-align: left;padding-right: 384px;margin-top: 73px;margin-bottom: 0px;} 
.p8{text-align: left;margin-top: 16px;margin-bottom: 0px;} 
.p9{text-align: left;padding-right: 123px;margin-top: 18px;margin-bottom: 0px;} 
.p10{text-align: left;padding-right: 123px;margin-top: 33px;margin-bottom: 0px;} 
.p11{text-align: left;margin-top: 53px;margin-bottom: 0px;} 
.p12{text-align: left;margin-top: 54px;margin-bottom: 0px;} 
.p13{text-align: left;padding-right: 131px;margin-top: 17px;margin-bottom: 0px;} 
.p14{text-align: left;margin-top: 0px;margin-bottom: 0px;white-space: nowrap;} 
.p15{text-align: left;padding-left: 29px;margin-top: 0px;margin-bottom: 0px;white-space: nowrap;} 

.td0{padding: 0px;margin: 0px;width: 115px;vertical-align: bottom;} 
.td1{padding: 0px;margin: 0px;width: 103px;vertical-align: bottom;} 

.tr0{height: 17px;} 
.tr1{height: 22px;} 

.t0{width: 218px;margin-left: 96px;margin-top: 17px;font: 15px 'Arial';} 

</STYLE> 
</HEAD> 

<BODY> 
<DIV id=\"page_1\"> 


<DIV> 
<DIV id=\"id_1\"> 
<P class=\"p0 ft0\">Board of Trustees</P> 
<P class=\"p1 ft1\">REDACTED</P> 
<P class=\"p6 ft4\">“Nurturing Hearts,</P> 
<P class=\"p2 ft5\">Developing Minds”</P> 
</DIV> 
<DIV id=\"id_2\"> 
<P class=\"p0 ft6\">$today</P> 
<P class=\"p7 ft6\">$title $first_name $last_name<br>$street_address<br>$city, $state $zip</P> 
<P class=\"p8 ft6\">Dear $title $last_name,</P> 
<P class=\"p9 ft6\">We have received your generous donation of $$mathAmt.00, and we are truly grateful. Since its founding in 1970, The School has been fortunate to receive philanthropic support from forward looking people like you who understand and appreciate the unique significance of our school’s mission in our community. Over these past <NOBR>forty-one</NOBR> years, many of our graduates have become respected professionals and leaders in our community, and our school is widely acknowledged as an important education resource in our region.</P> 
<P class=\"p10 ft6\">On behalf of the Board of Trustees, the Faculty, and our Students, who are the ultimate recipients of your generosity, I wish to personally thank you. Your sacrificial donation sends an especially powerful message during theses challenging economic times about your devotion to the school.</P> 
<P class=\"p11 ft6\">Sincerely yours,</P> 
<P class=\"p12 ft6\">James </P> 
<P class=\"p0 ft6\">Headmaster</P> 
<P class=\"p13 ft8\">For tax purposes, School is pleased to provide the following information. No goods or services were rendered in exchange for this contribution. Please retain this letter for income tax purposes. This written acknowledgement of your donation serves as the substantiation required under section 170 of the Internal Revenue Code.</P> 
<TABLE cellpadding=0 cellspacing=0 class=\"t0\"> 
<TR> 
    <TD class=\"tr0 td0\"><P class=\"p14 ft8\">Date of Gift:</P></TD> 
    <TD class=\"tr0 td1\"><P class=\"p15 ft8\">1/19/2012</P></TD> 
</TR> 
<TR> 
    <TD class=\"tr1 td0\"><P class=\"p14 ft8\">Value of Gift*<SPAN class=\"ft6\">:</SPAN></P></TD> 
    <TD class=\"tr1 td1\"><P class=\"p15 ft8\">$$mathAmt.00</P></TD> 
</TR> 
</TABLE> 
</DIV> 
</DIV> 
</DIV> 

</body> 
</HTML> 

"; 

답변

0

이메일이 잘 보이는, 그래서 당신이를 제외하고 아무 잘못, 일을 생각하지 않는다 :

대부분의 이메일 클라이언트는 지원하지 않습니다를 div 기반 레이아웃 또는 비 인라인 스타일. 레이아웃과 모든 CSS 인라인 테이블을 사용하여 이메일을 다시 보내야합니다 (또는 사용되지 않는 html 속성을 통해 선언해야합니다).

http://htmlemailboilerplate.com/ 일부 이메일 고유성에 도움이 될 수 있습니다.

+0

스택 오버플로는 JSFiddle 링크 만 추가하도록 게시물을 편집 할 수는 없지만 http://jsfiddle.net/Tpf3B/ – greg5green

+0

에서 작동중인 이메일을 볼 수 있습니다. 브라우저에서 잘 보였지만 나는 이것에 꽤 새로울 정도로 나는 내가 아직도 무엇인가 고치고있는 것이라고 상상했다, haha. 제안 해 주셔서 감사합니다. – Joel

+0

그것으로 시간을 내십시오. HTML 전자 메일을 작성하는 것은 "일반"웹 사이트를 만드는 것과 비교하여 매우 어려울 수 있습니다. 귀하의 물건이 큰 물건에 대해 유효성을 확인했는지 확인하십시오 ("지원되지 않는"속성을 사용하는 것은 큰 문제가 아니지만 tr 및 테이블이 모두 닫혀 있는지 확인하는 것입니다). 또한 스타일 블록에서 작성하는 CSS를 인라인 스타일로 이동하려면 http://premailer.dialect.ca/를 확인하십시오. – greg5green