473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HTML mail does not work?

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 = 's******@thisnewsgroup.com
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
Nov 19 '05 #1
2 1445
You're using an external style sheet. Windows XP Service Pack 2 disallows
this by default (apparently a security issue), and the user would have to
turn it on to use the style sheet. See the following article on the subject:

http://www.emaillabs.com/articles/em...2_upgrade.html

The solution would be to write the style sheet into the HTML page that is
the body of the email.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Roel Korsten" <spam_sucks> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
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 = 's******@thisnewsgroup.com
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

Nov 19 '05 #2
Thanx Kevin! Now it works like a charm...
Kevin Spencer schreef:
You're using an external style sheet. Windows XP Service Pack 2 disallows
this by default (apparently a security issue), and the user would have to
turn it on to use the style sheet. See the following article on the subject:

http://www.emaillabs.com/articles/em...2_upgrade.html

The solution would be to write the style sheet into the HTML page that is
the body of the email.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

"Roel Korsten" <spam_sucks> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
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 = 's******@thisnewsgroup.com
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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rainmaker | last post by:
Greetings, I have not been able to find the documentation that will allow me to insert php code inside the html code in the $message block in the mail() function. Using the example in the help...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
10
by: Ukiharappa | last post by:
Hello All, I am not sure why. It works on Outlook and other mail clients. I have put it as an include file to the .css instead of putting it inline with the html email. Anyody has any ideas...
3
by: T.Michelle | last post by:
We have few Mail templates (.html) which we use to send mails. We want to have some Logo in that ie ... when I send the mail to user the image should go as in-line embedded image in mail....
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
7
by: Arne | last post by:
How do I send HTML email with the System.Web.Mail namespace? I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML> in the body of the email, but it didn't work. MY html tags became...
3
by: Bill Woodruff | last post by:
I have a small light-weight winform app (C# .NET 2.0) that does some web-scraping and, under certain conditions, needs to send a plain-text e-mail. This is simple for mail servers that don't...
78
by: Robert Baer | last post by:
The homepage i have had up and seemingly working is: http://oil4lessllc.com/ However, the validator has so many complaints, and being so incompetent, i have no clue as to how to fix it all. Would...
21
by: maya | last post by:
hi, I'm designing an HTML email for a client.. I know general guidelines (no CSS, no JavaScript... although I do use limited CSS, inside tags (as in <span style=".."we do this at work and it...
14
by: jcage | last post by:
Is there any tutorials online for sending email through forms? I can send an email as well as write to my MySQL database from home with the following code but not at work. I think there might be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.