hat schon jemand erfolgreich ein HTML Mail mit SendHTMLMail versendet?
Ich frickel mir schon wieder den ganzen Vormittag einen ab und bekomme das natürlich nicht hin.
Eine Mail zu versenden ist grundsätzlich kein Problem - das klappt. Nun möchte ich das Ganze aber schön bunt. Das übersteigt mal wieder mein können.
Das ist mein HTML Code, der auch so im Browser funktioniert:
Code: Alles auswählen
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MY AWESOME HOME</title>
<meta content="width=device-width; initial-scale=1.0"/>
</head>
</html>
<body style="margin: 0; padding: 20px 0 30px 0;">
<table align="center" border="1" cellpadding="0" cellspacing="0" width="600" style="border: 1px solid #cccccc;">
<tr>
<td align="center" bgcolor="#83BAF3" style="padding: 10px 0 2px 0;">
<img src="https://raw.githubusercontent.com/domjo75/HA-LogoPic/main/logo-with-text.png" alt="header" width="400" height="100" style="display: block; padding: 20px 10px 20px 10px;" />
</td>
</tr>
<tr>
<td bgcolor="#ffffff" style="padding: 150px 10px 150px 10px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" width="150" hight="150" valign="center">
<img src="https://raw.githubusercontent.com/domjo75/HA-LogoPic/main/waste-tin-plastic.png" alt="wastepic" width="70%" style="display: block;" />
<td width="200" valign="center" style="font-family: Verdana, sans-serif; font-size: 20px; line-height: 25px;">
<font color="#000000">Morgen wird der Bio Müll abgeholt.</font><br />
<font color="#000000">Bitte die Tonne rausstellen</font><br /><br />
<font color="#000000">Danke 😘</font><br />
</td>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" bgcolor="#83BAF3" style="font-family: Verdana, sans-serif; font-size: 15px; line-height: 20px; padding: 5px 0px 5px 0px;">
<font color="#ffffff">created with</font>
<font color="#FF0000"> ♥ </font>
</td>
</tr>
</table>
</body>
Code: Alles auswählen
val mailActions = getActions("mail","mail:smtp:1c20f9e8a9")
var message = "<!DOCTYPE html>\n";
message += "<html>\n";
message += "<head>\n";
message += "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n";
message += "<title>MY AWESOME HOME</title>\n";
message += "<meta/>\n";
message += "</head>\n";
message += "</html>\n";
message += "<body style="margin 0; padding 20px 0 30px 0;">\n";
message += "<table align="center" border="1" cellpadding="0" cellspacing="0" width="600" style="border 1px solid #cccccc;">\n";
message += "<tr>\n";
message += "<td align="center" bgcolor="#83BAF3" style="padding 10px 0 2px 0;">\n";
message += "<img src="https://raw.githubusercontent.com/domjo75/HA-LogoPic/main/logo-with-text.png" alt="header" width="500" height="130" style="display block;" />\n";
message += "</td>\n";
message += "</tr>\n";
message += "<tr>\n";
message += "<td bgcolor="#ffffff" style="padding 150px 10px 150px 10px;">\n";
message += "<table border="0" cellpadding="0" cellspacing="0" width="100%">\n";
message += "<tr>\n";
message += "<td align="center" width="150" hight="150" valign="center">\n";
message += "<img src="https://raw.githubusercontent.com/domjo75/HA-LogoPic/main/waste-tin-plastic.png" alt="wastepic" width="70%" style="display block;" />\n";
message += "<td width="200" valign="center" style="font-family Verdana, sans-serif; font-size 20px; line-height 25px;">\n";
message += "<font color="#000000">Morgen wird der Bio Müll abgeholt.</font><br />\n";
message += "<font color="#000000">Bitte die Tonne rausstellen</font><br /><br />\n";
message += "<font color="#000000">Danke 😘</font><br />\n";
message += "</td>\n";
message += "</td>\n";
message += "</tr>\n";
message += "</table>\n";
message += "</td>\n";
message += "</tr>\n";
message += "<tr>\n";
message += "<td align="center" bgcolor="#83BAF3" style="font-family Verdana, sans-serif; font-size 15px; line-height 20px; padding 5px 0px 5px 0px;">\n";
message += "<font color="#ffffff">created with</font>\n";
message += "<font color="#FF0000"> ♥ </font>\n";
message += "</td>\n";
message += "</tr>\n";
message += "</table>\n";
message += "</body>\n";
mailActions.sendHtmlMail("dom@gmx.de", "Testmail", message)
Code: Alles auswählen
mailActions.sendHtmlMail("dom@gmx.de", "Testmail", message)
1. no viable alternative at input 'solid'; line 12, column 518, length 5
2. no viable alternative at input '#'; line 14, column 600, length 1
3. mismatched character 'A' expecting set null; line 14, column 601, length 4
4. missing EOF at ':'; line 15, column 671, length 1
5. mismatched character 'A' expecting set null; line 35, column 1844, length 4
:/