0
所以我一直在搞亂一點點,並繼續提高我的PHP郵件。一切工作都很好,起起落落,終於實現了我想要的。PHP郵件內容不會顯示在Outlook中
這就是它看起來像
<?php
$headers .= "Content-Type: text/html; charset=UTF-8>\n";
$field_name = $_POST['cf_name'];
$field_age = $_POST['Alter'];
$field_ges = $_POST['Geschlecht'];
$field_gt = $_POST['Gamertag'];
$field_sona = $_POST['Socname'];
$field_rol = $_POST['Rolle'];
$overall_message = 'Vorname: ' . $field_name . '<br>
Alter: ' . $field_age . '<br>
Geschlecht: ' . $field_ges . '<br>
Gamertag: ' . $field_gt . '<br>
SocialClub-Name: ' . $field_sona . '<br>
Rolle: ' . $field_rol;
$subject = 'xRL Anmeldung - ' . $field_rol . ': ' . $field_name;
$body_message = '<!DOCTYPE html>
<html>
<head>
<style>
html, body {
margin: 0;
padding: 0;
}
#Mailnap {
text-align: center;
}
#Mailna {
text-align: center;
}
.Hgrund {
margin: 0;
padding: 0;
background-color: #DCDCDC;
}
table {
height: 60px;
width: 100%;
border: 0px;
}
.Header {
height: 60px;
width: 100%;
background-color: #1F1F1F;
border: 0px;
}
.Header th {
width: 83px;
height: 60px;
border: 0px;
background-color: #DCDCDC;
}
.Header td {
border: 0px;
text-align: center;
}
.Header td a {
fonz-size: 24px;
text-align: center;
color: #FFFFFF;
border-bottom: 3px solid #FFFFFF;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
text-decoration: none;
}
.Header td a:hover {
border-bottom: 3px solid #FF0000;
}
.Content {
width: 98%;
background-color: #696969;
margin: 0 1% 0 1%;
padding: 0;
}
.ContentICBG {
width: 95%;
padding: 0;
margin: 10px auto 10px auto;
background-color: #DCDCDC;
}
.Content h1 {
width: 100%;
margin: 0;
padding: 0;
font-size: 24px;
text-align: center;
background-color: #D5C4A1;
color: #000000;
}
.ContentICBG p {
padding: 10px 10px 10px 10px;
}
</style>
</head>
<body>
<p id="Mailnap"><a href="https://xGamesHub.com/DE/MailFeedback" id="Mailna">Wird diese Mail nicht richtig angezeigt? Klicke bitte hier, und lasse es und wissen!</a></p>
<div class="Hgrund">
<table style="background-color:#DCDCDC;border-bottom:3px solid #DCDCDC;">
<tr class="Header">
<th><img src="https://xForigens.com/de-DE/Clans/GTAxRL/xRLN60.png"/></th>
<td><a href="https://xGamesHub.com/DE/" style="">STARTSEITE</a></td>
<td><a href="https://xGamesHub.com/DE/Gaming-News/" style="">GAMING NEWS</a></td>
<td><a href="https://xGamesHub.com/Forum" style="">Forum</a></td>
<td><a href="https://xForigens.com/de-DE/Clans/SEK1" style="">SEK1</a></td>
<td><a href="https://xForigens.com/de-DE/Clans/GTAxRL/" style="">xRL</a></td>
</tr>
</table>
<div class="Content">
<h1>' . $subject . '</h1>
<div class="ContentICBG">
<p>' . $overall_message . '</p>
</div>
<h1>Gesendet von: ' . $field_name . '</h1>
</div>
<div style="margin:0;padding:0;background-color:#1F1F1F;border-top:3px solid #DCDCDC;height:30px;width:100%">
<p style="color:#FFFFFF;text-align:right;font-size:15px;margin:10px 10px 0 0;padding:0;"><a style="color:#FFFFFF;text-decoration:none;" href="https://xForigens.com/de-DE/About">Über</a> | ©2017 xForigens</p>
</div>
</div>
</body>
</html>';
$mail_to = '[email protected]';
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Danke, wir werden uns in den nächsten 7 Tagen melden.\n\nDamit Du mit am Projekt teilnehmen kannst, musst Du nun mit deinem angegebenen Gamertag, und deinem SocialClub-Name anfragen an Crew & Club senden!')
window.history.back()
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Wenn die Mailfunktion ausfällt, versuche diese erneut zu senden, oder wende Dich an die Administration.')
window.history.back();
</script>
<?php
}
?>
一切是偉大的。所以我添加了幾行,因爲我希望顯示自己的地址等,而不是[email protected]。
現在它看起來像這樣
<?php
$headers .= "Content-Type: text/html; charset=UTF-8>\n";
$headers .= "From: xForigens | xRL<[email protected]>\n";
$headers .= "Reply-To: MailFeedback<[email protected]>\n";
$headers .= "X-Mailer: PHP v".phpversion()."\n";
$field_name = $_POST['cf_name'];
$field_age = $_POST['Alter'];
$field_ges = $_POST['Geschlecht'];
$field_gt = $_POST['Gamertag'];
$field_sona = $_POST['Socname'];
$field_rol = $_POST['Rolle'];
$overall_message = 'Vorname: ' . $field_name . '<br>
Alter: ' . $field_age . '<br>
Geschlecht: ' . $field_ges . '<br>
Gamertag: ' . $field_gt . '<br>
SocialClub-Name: ' . $field_sona . '<br>
Rolle: ' . $field_rol;
$subject = 'xRL Anmeldung - ' . $field_rol . ': ' . $field_name;
$body_message = '<!DOCTYPE html>
<html>
<head>
<style>
html, body {
margin: 0;
padding: 0;
}
#Mailnap {
text-align: center;
}
#Mailna {
text-align: center;
}
.Hgrund {
margin: 0;
padding: 0;
background-color: #DCDCDC;
}
table {
height: 60px;
width: 100%;
border: 0px;
}
.Header {
height: 60px;
width: 100%;
background-color: #1F1F1F;
border: 0px;
}
.Header th {
width: 83px;
height: 60px;
border: 0px;
background-color: #DCDCDC;
}
.Header td {
border: 0px;
text-align: center;
}
.Header td a {
fonz-size: 24px;
text-align: center;
color: #FFFFFF;
border-bottom: 3px solid #FFFFFF;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
text-decoration: none;
}
.Header td a:hover {
border-bottom: 3px solid #FF0000;
}
.Content {
width: 98%;
background-color: #696969;
margin: 0 1% 0 1%;
padding: 0;
}
.ContentICBG {
width: 95%;
padding: 0;
margin: 10px auto 10px auto;
background-color: #DCDCDC;
}
.Content h1 {
width: 100%;
margin: 0;
padding: 0;
font-size: 24px;
text-align: center;
background-color: #D5C4A1;
color: #000000;
}
.ContentICBG p {
padding: 10px 10px 10px 10px;
}
</style>
</head>
<body>
<p id="Mailnap"><a href="https://xGamesHub.com/DE/MailFeedback" id="Mailna">Wird diese Mail nicht richtig angezeigt? Klicke bitte hier, und lasse es und wissen!</a></p>
<div class="Hgrund">
<table style="background-color:#DCDCDC;border-bottom:3px solid #DCDCDC;">
<tr class="Header">
<th><img src="https://xForigens.com/de-DE/Clans/GTAxRL/xRLN60.png"/></th>
<td><a href="https://xGamesHub.com/DE/" style="">STARTSEITE</a></td>
<td><a href="https://xGamesHub.com/DE/Gaming-News/" style="">GAMING NEWS</a></td>
<td><a href="https://xGamesHub.com/Forum" style="">Forum</a></td>
<td><a href="https://xForigens.com/de-DE/Clans/SEK1" style="">SEK1</a></td>
<td><a href="https://xForigens.com/de-DE/Clans/GTAxRL/" style="">xRL</a></td>
</tr>
</table>
<div class="Content">
<h1>' . $subject . '</h1>
<div class="ContentICBG">
<p>' . $overall_message . '</p>
</div>
<h1>Gesendet von: ' . $field_name . '</h1>
</div>
<div style="margin:0;padding:0;background-color:#1F1F1F;border-top:3px solid #DCDCDC;height:30px;width:100%">
<p style="color:#FFFFFF;text-align:right;font-size:15px;margin:10px 10px 0 0;padding:0;"><a style="color:#FFFFFF;text-decoration:none;" href="https://xForigens.com/de-DE/About">Über</a> | ©2017 xForigens</p>
</div>
</div>
</body>
</html>';
$mail_to = '[email protected]';
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Danke, wir werden uns in den nächsten 7 Tagen melden.\n\nDamit Du mit am Projekt teilnehmen kannst, musst Du nun mit deinem angegebenen Gamertag, und deinem SocialClub-Name anfragen an Crew & Club senden!')
window.history.back()
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Wenn die Mailfunktion ausfällt, versuche diese erneut zu senden, oder wende Dich an die Administration.')
window.history.back();
</script>
<?php
}
?>
在Outlook.com不會顯示任何內容了,重音符號(或任何那些是再次)像AOU/AOU顯示不正確了,和不同mailservices現在問我是否希望顯示我的標題圖片。在沒有beeing問之前。請幫助。
我沒有注意到「>」哈哈。在刪除之後,不明之處,例如頁腳鏈接「Über」現在再次正確顯示。我並不認爲我也會支持不好,但我被告知有所不同。並刪除>後,它的工作原理應該如此。 謝謝 – xFgn