salve!!
sapreste voi spiegarmi perche' se invio una mail in formato html senza un allegato non viene correttamente visualizzata, se invece la stessa con un allegato (anche da 0 kb) l'html viene visualizzato correttamente?
sapreste voi spiegarmi perche' se invio una mail in formato html senza un allegato non viene correttamente visualizzata, se invece la stessa con un allegato (anche da 0 kb) l'html viene visualizzato correttamente?
B4X:
Dim sb As StringBuilder
sb.Initialize
sb.Append("<!DOCTYPE html Public " & Chr(34) & "-//W3C//DTD XHTML 1.0 Transitional//EN" & Chr(34) & " " & Chr(34) & "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" & Chr(34) & ">")
sb.Append("<html xmlns=" & Chr(34) & "http://www.w3.org/1999/xhtml" & Chr(34) & ">")
sb.Append("<head>")
sb.Append("<title>email</title>")
sb.Append("</head>")
sb.Append("<body style=" & Chr(34) & "background: magenta; margin: 10; padding: 20; background: #006200; color: blue" & Chr(34) & ">")
sb.Append("<h1 class=" & Chr(34) & "bright" & Chr(34) & " style=" & Chr(34) & "font-size: 3em; background: black; color: white" & Chr(34) & "></h1>")
sb.Append("<h1 style=" & Chr(34) & "font-size: 3em" & Chr(34) & ">Hello</h1>")
sb.Append("<p style=" & Chr(34) & "padding: 0.3em; background: red" & Chr(34) & ">test <em>love</em> test test</p>")
sb.Append("<h2 style=" & Chr(34) & "font-size: 2em; color: yellow" & Chr(34) & ">Alright</h2>")
sb.Append("<p style=" & Chr(34) & "padding: 0.3em; background: red" & Chr(34) & ">it's a good day</p>")
sb.Append("<p style=" & Chr(34) & "padding: 0.3em; background: red" & Chr(34) & ">mike</p>")
sb.Append("<h3 id=" & Chr(34) & "dull" & Chr(34) & " style=" & Chr(34) & "font-size: 1em; background: gray; color: black" & Chr(34) & ">All done.</h3>")
sb.Append("</body>")
sb.Append("</html>")
mySmtp.HtmlBody = True
mySmtp.AddAttachment(File.DirAssets,"test.txt") ' <--- SE QUESTA RIGA, L'HTML VIENE VISUALIZZATO, ALTRIMENTI NO !?!?!?
mySmtp.Body = sb
mySmtp.Send