내 웹 사이트의 버튼을 누른 후 메일을 보내고 있으며,이 메일에있는 본문은 HTML 및 CSS로 작성되었습니다. 일부 서식이 필요하기 때문입니다. 문제는 이제 모든 CSS가 작동하는 것은 아니며 메일에서 HTML을 사용하도록 설정하여 문제가되지 않도록하는 것입니다. 주로 색칠과 패딩이 테이블에서 작동하지 않습니다. 완전히 새로운 프로젝트에서 테스트 할 때 HTML과 CSS가 작동합니다.CSS가 이메일 본문에서 작동하지 않습니다.
저는 C#과 ASP.NET을 사용하고 있습니다. 끝에
border: 1px;
border-style: solid;
border-collapse: collapse;
padding: 5px;
padding-right: 40px;
max-width: 350px;
나는 기본적으로 그냥 보낸 사람을 추가 해요, 수신기와 이러한이 작동하지 않는 스타일이다`
lMessage.Subject = "Versandformular";
lMessage.IsBodyHtml = true;
lMessage.Body = "<html>" +
"<head>" +
" <title>Versandformular</title>" +
" <style>" +
" body {" +
" font-family: Verdana;" +
" }" +
" .artikel > table td, .artikel > table th, .artikel > table {" +
" border: 1px;" +
" border-style: solid;" +
" border-collapse: collapse;" +
" padding: 5px;" +
" padding-right: 40px;" +
" max-width: 350px;" +
" text-align: left;" +
" }" +
" .versand {" +
" border: none;" +
" }" +
" .artikel .versand {" +
" width: 350px;" +
" }" +
" </style>" +
"</head>" +
"<body>" +
" <h2>" +
" Versandformular" +
" </h2>" +
" <div class='container'>" +
" <div class='absender'>" +
" <b>Absender:</b><br />" +
" John Doe<br />" +
" Some street<br />" +
" Some city <br />" +
" /567890" +
" </div>" +
" <br />" +
" <div class='empfaenger'>" +
" <b>Empfänger</b><br />" +
" Max Mustermann GmbH & Co. KG<br />" +
" Max Mustermann<br />" +
" /5678910<br />" +
" [email protected]<br />" +
" Musterstraße 123<br />" +
" 12345 Musterstadt<br />" +
" Deutschland<br />" +
" Bundesstaat: Keine Angabe<br />" +
" Bemerkungen:<br />" +
" <div class='empf-bemerkung'>" +
" </div>" +
" </div>" +
" <br />" +
" <div class='versand'>" +
" <b>Versand</b>" +
" <table>" +
" <tr>" +
" <td>Versandart</td>" +
" <td>Dokumentsendung EU</td>" +
" </tr>" +
" <tr>" +
" <td>Versanddienst</td>" +
" <td>Standard</td>" +
" </tr>" +
" <tr>" +
" <td>Bemerkungen</td>" +
" <td>Irgendetwas was mit dem Versand zu tun hat</td>" +
" </tr>" +
" <tr>" +
" <td>Nächsten Lieferung beipacken?</td>" +
" <td>Ja</td>" +
" </tr>" +
" <tr>" +
" <td>Termin bis:</td>" +
" <td></td>" +
" </tr>" +
" <tr>" +
" <td>Warenkosten Zahlung</td>" +
" <td>Proforma</td>" +
" </tr>" +
" <tr>" +
" <td>Kostenträger</td>" +
" <td>Absender</td>" +
" </tr>" +
" <tr>" +
" <td>Kostenstelle</td>" +
" <td>IT</td>" +
" </tr>" +
" <tr>" +
" <td>Tracking angeforderdert?</td>" +
" <td>Ja</td>" +
" </tr>" +
" </table>" +
" </div>" +
" <br />" +
" <div class='artikel'>" +
" <b>Artikel</b>" +
" <table>" +
" <tr>" +
" <th>#</th>" +
" <th>ArtikelNr</th>" +
" <th>WarentarifNr</th>" +
" <th>Menge</th>" +
" <th>Preis</th>" +
" <th>Beschreibung</th>" +
" </tr>" +
" <tr>" +
" <td>1</td>" +
" <td>1234567890</td>" +
" <td>1234 5678</td>" +
" <td>5 Stk.</td>" +
" <td>5€</td>" +
" <td>Jede Menge Schrauben</td>" +
" </tr> " +
" </table>" +
" </div>" +
" </div>" +
"</body>" +
"</html>";`
: 여기
내가 사용하고 코드입니다 PDF 첨부 파일. 또한 테스트 할 텍스트가 가득 차 있습니다. 필자는 Internet Explorer와 Outlook 2013 및 2010에서만 테스트를 완료했습니다.
정확히 어떤 CSS 라인이 작동하지 않는지 명확히 할 수 있습니까? 다른 브라우저와 다른 메일 클라이언트도 테스트 해 보셨습니까? –
하나의 철자 오류 : "Vesandformular"는 "V ** R ** sandformular"이어야합니다. –
Ooh sry : D 곧 해결할 것입니다. – xFlowDev