R
Roel Korsten
Hello all,
I've got a strange one: I'm sending HTML mail via the System.Web.Mail
namespace:
Dim ObjEmail As New MailMessage
Dim sb As New StringBuilder
ObjEmail.To = '(e-mail address removed)
ObjEmail.From = ConfigurationSettings.AppSettings("MailFrom")
ObjEmail.Subject = OnderwerpTextBox.Text
ObjEmail.BodyFormat = MailFormat.Html
ObjEmail.Body = Funcs.Nieuwsbrief(OnderwerpTextBox.Text,
BerichtTextbox.Text.Replace(vbCrLf, "<br>"))
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("MailSMTP")
SmtpMail.Send(ObjEmail)
In the "Funcs.Nieuwsbrief" method (which populates the body of the e-mail) I
generate the following HTML:
<html>
<head>
<link href='http://www.kubbus.nl/style/styles.css' type='text/css'
rel='stylesheet'>
</head>
<body class='body'>
<table class='table_main' align='center' cellpadding='5' cellspacing='5'>
<tr>
<td colspan='3' align='center'>
<table border='0' cellspacing='0' cellpadding='0' height='124px'
width='100%'
background='http://www.kubbus.nl/images/top1.gif'><tr><td></td></tr></table>
<table border='0' cellspacing='0' cellpadding='0' height='26px' width='100%'
background='http://www.kubbus.nl/images/top2.gif'><tr><td></td></tr></table>
<table border='0' cellspacing='0' cellpadding='0' height='17px' width='100%'
background='http://www.kubbus.nl/images/top3.gif'><tr><td></td></tr></table>
</td>
</tr>
<tr>
<td colspan='3' valign='top' class='table_middle'>
<table align='center' width='70%'>
<tr>
<td colspan='3'><p align='center' class='table_header'>
Dit is het onderwerp
</p>
</td>
</tr>
<tr>
<td colspan='3'><br>
<table align='center'>
<tr>
<td class='content_black'>
Dit is het bericht
<br><br>
</td>
</tr>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan='3' align='center' class='content_black_small'>
© 2005 Café Partycentrum Kubbus - alle rechten voorbehouden
</td>
</tr>
</table>
</body>
</html>
When I look at this HTML in IE the page gets rendered perfectly. When I open
the e-mail, all the style is gone!
What's going on?
Greetings,
Roel Korsten
I've got a strange one: I'm sending HTML mail via the System.Web.Mail
namespace:
Dim ObjEmail As New MailMessage
Dim sb As New StringBuilder
ObjEmail.To = '(e-mail address removed)
ObjEmail.From = ConfigurationSettings.AppSettings("MailFrom")
ObjEmail.Subject = OnderwerpTextBox.Text
ObjEmail.BodyFormat = MailFormat.Html
ObjEmail.Body = Funcs.Nieuwsbrief(OnderwerpTextBox.Text,
BerichtTextbox.Text.Replace(vbCrLf, "<br>"))
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("MailSMTP")
SmtpMail.Send(ObjEmail)
In the "Funcs.Nieuwsbrief" method (which populates the body of the e-mail) I
generate the following HTML:
<html>
<head>
<link href='http://www.kubbus.nl/style/styles.css' type='text/css'
rel='stylesheet'>
</head>
<body class='body'>
<table class='table_main' align='center' cellpadding='5' cellspacing='5'>
<tr>
<td colspan='3' align='center'>
<table border='0' cellspacing='0' cellpadding='0' height='124px'
width='100%'
background='http://www.kubbus.nl/images/top1.gif'><tr><td></td></tr></table>
<table border='0' cellspacing='0' cellpadding='0' height='26px' width='100%'
background='http://www.kubbus.nl/images/top2.gif'><tr><td></td></tr></table>
<table border='0' cellspacing='0' cellpadding='0' height='17px' width='100%'
background='http://www.kubbus.nl/images/top3.gif'><tr><td></td></tr></table>
</td>
</tr>
<tr>
<td colspan='3' valign='top' class='table_middle'>
<table align='center' width='70%'>
<tr>
<td colspan='3'><p align='center' class='table_header'>
Dit is het onderwerp
</p>
</td>
</tr>
<tr>
<td colspan='3'><br>
<table align='center'>
<tr>
<td class='content_black'>
Dit is het bericht
<br><br>
</td>
</tr>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan='3' align='center' class='content_black_small'>
© 2005 Café Partycentrum Kubbus - alle rechten voorbehouden
</td>
</tr>
</table>
</body>
</html>
When I look at this HTML in IE the page gets rendered perfectly. When I open
the e-mail, all the style is gone!
What's going on?
Greetings,
Roel Korsten