Saturday, March 24, 2012
HTML Email.
My booking system sends a HTML formated email as a recipt to the client
on completion of their booking. All is working well however it has been
pointed out to me that not all people's email clients will display the
reciept as HTML, if for instance the person has chosen to view email's as
plain text only, then the email will render as a unpleasent text. It is
crucial that the person visible see the information in the reciept presented
nicely, regardless of if there email client has been configured to show
email as HTML or plin text.
I have done a bit of research and found that I ca show either HTML of email
by altering a setting in the message headers.
My question is can I ammend the message headers directly through vb.net (or
any other dot net language) or will I have to use a third party component
for this, if so has anybody got any recomendations.
cheers
martin.System.Web.Mail.MailMessage exposes the Headers property, which will return
an IDictionary object that you can use to modify the headers.
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Alex" <alex_REMOVE_9876@.yahoo.com> wrote in message
news:ebvSd5ApDHA.2456@.TK2MSFTNGP09.phx.gbl...
> Hi,
> My booking system sends a HTML formated email as a recipt to the client
> on completion of their booking. All is working well however it has been
> pointed out to me that not all people's email clients will display the
> reciept as HTML, if for instance the person has chosen to view email's as
> plain text only, then the email will render as a unpleasent text. It is
> crucial that the person visible see the information in the reciept
presented
> nicely, regardless of if there email client has been configured to show
> email as HTML or plin text.
> I have done a bit of research and found that I ca show either HTML of
> by altering a setting in the message headers.
> My question is can I ammend the message headers directly through vb.net
(or
> any other dot net language) or will I have to use a third party component
> for this, if so has anybody got any recomendations.
>
> cheers
> martin.
Hi Chris,
Thanks for that advice.
However I am a little perplexed by this property.
The documentation says
Specifies the custom headers that are transmitted with the e-mail message.
but the definitions says
[Visual Basic]
Public ReadOnly Property Headers As IDictionary
so what I am wondering is how exactly I set the headers of a attributes of a
read only property.
I can't seem to find any good examples of this, do you know of any or can
you point me in the right direction.
cheers
Alex.
"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:OzslbcKpDHA.2612@.TK2MSFTNGP10.phx.gbl...
> System.Web.Mail.MailMessage exposes the Headers property, which will
return
> an IDictionary object that you can use to modify the headers.
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows XP
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Alex" <alex_REMOVE_9876@.yahoo.com> wrote in message
> news:ebvSd5ApDHA.2456@.TK2MSFTNGP09.phx.gbl...
> > Hi,
> > My booking system sends a HTML formated email as a recipt to the
client
> > on completion of their booking. All is working well however it has been
> > pointed out to me that not all people's email clients will display the
> > reciept as HTML, if for instance the person has chosen to view email's
as
> > plain text only, then the email will render as a unpleasent text. It is
> > crucial that the person visible see the information in the reciept
> presented
> > nicely, regardless of if there email client has been configured to show
> > email as HTML or plin text.
> > I have done a bit of research and found that I ca show either HTML of
> > by altering a setting in the message headers.
> > My question is can I ammend the message headers directly through vb.net
> (or
> > any other dot net language) or will I have to use a third party componen
t
> > for this, if so has anybody got any recomendations.
> > cheers
> > martin.
HTML Email
I am using the system.net.mail class to send out email in HTML
format. I have a few images in the HTML page. In order to have the
images display without referencing the server, attaching the images to
the email and calling the image like - '<img src='email2.jpg'> works
fine to me (atleast in an internal network).
I keep reading in the posts that when an email is sent to
yahoo/hotmail accnt, the images does not show up. I believe, it is an
option/setup thing? Let me know if i am wrong or missing something.
I am trying to find if I can test this on a external mail server
(just to make sure it actually works). It would be great if anybody has
any pointers? I was unable to find a mail server which accepts a mail
generated programmatically. I understand it is got to do with open
relays.
Thanks,
Sam
HTML Email
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 text.
What can I do?Hi,
You need to set the
Mail.BodyFormat = MailFormat.Html
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> 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 text.
> What can I do?
>You need to set the
>Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.
>(Assuming Mail is the name of your mail object).
>Best regards,
>Dave Colliver.
>http://www.ManchesterFOCUS.com
>~~
>http://www.FOCUSPortals.com - Local franchises available
>
>"Arne" <Arne@.discussions.microsoft.com> wrote in message
>news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>
Alan Silver
(anything added below this line is nothing to do with me)
Yes it does.
"Alan Silver" wrote:
> Do you know if it can handle multi-part e-mails? What I mean is ones
> sent in both plain text and HTML. That way, the e-mail client being used
> can display whichever it feels (or the user has specified).
> Thanks.
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
>"Alan Silver" wrote:
>
Alan Silver
(anything added below this line is nothing to do with me)
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:
> OK, maybe I should have been a bit more specific with my question!!
> *How* do you do these types of e-mails? I couldn't see anything in the
> SDK - which doesn't mean it's not there, just that I couldn't find it.
> TIA
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>Mail.BodyFormat = MailFormat.Html
>will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>No, the documentation will not tell you everything you need to know about
>email.
>"Alan Silver" wrote:
>
Alan Silver
(anything added below this line is nothing to do with me)
HTML Email
I am using the system.net.mail class to send out email in HTML
format. I have a few images in the HTML page. In order to have the
images display without referencing the server, attaching the images to
the email and calling the image like - '<img src='http://pics.10026.com/?src=email2.jpg'works
fine to me (atleast in an internal network).
I keep reading in the posts that when an email is sent to
yahoo/hotmail accnt, the images does not show up. I believe, it is an
option/setup thing? Let me know if i am wrong or missing something.
I am trying to find if I can test this on a external mail server
(just to make sure it actually works). It would be great if anybody has
any pointers? I was unable to find a mail server which accepts a mail
generated programmatically. I understand it is got to do with open
relays.
Thanks,
Sam
HTML Email
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 text.
What can I do?Hi,
You need to set the
Mail.BodyFormat = MailFormat.Html
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> 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 text.
> What can I do?
>You need to set the
>Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.
>(Assuming Mail is the name of your mail object).
>Best regards,
>Dave Colliver.
>http://www.ManchesterFOCUS.com
>~~
>http://www.FOCUSPortals.com - Local franchises available
>
>"Arne" <Arne@.discussions.microsoft.com> wrote in message
>news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>> 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 text.
>>
>> What can I do?
--
Alan Silver
(anything added below this line is nothing to do with me)
Yes it does.
"Alan Silver" wrote:
> >You need to set the
> >Mail.BodyFormat = MailFormat.Html
> Do you know if it can handle multi-part e-mails? What I mean is ones
> sent in both plain text and HTML. That way, the e-mail client being used
> can display whichever it feels (or the user has specified).
> Thanks.
> >(Assuming Mail is the name of your mail object).
> >Best regards,
> >Dave Colliver.
> >http://www.ManchesterFOCUS.com
> >~~
> >http://www.FOCUSPortals.com - Local franchises available
> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> >> 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 text.
> >>
> >> What can I do?
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
>"Alan Silver" wrote:
>> >You need to set the
>>> >Mail.BodyFormat = MailFormat.Html
>>
>> Do you know if it can handle multi-part e-mails? What I mean is ones
>> sent in both plain text and HTML. That way, the e-mail client being used
>> can display whichever it feels (or the user has specified).
>>
>> Thanks.
>>
>> >(Assuming Mail is the name of your mail object).
>>> >Best regards,
>> >Dave Colliver.
>> >http://www.ManchesterFOCUS.com
>> >~~
>> >http://www.FOCUSPortals.com - Local franchises available
>>>> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
>> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>> >> 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 text.
>> >>
>> >> What can I do?
>>>>
>> --
>> Alan Silver
>> (anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:
> >Yes it does.
> OK, maybe I should have been a bit more specific with my question!!
> *How* do you do these types of e-mails? I couldn't see anything in the
> SDK - which doesn't mean it's not there, just that I couldn't find it.
> TIA
> >"Alan Silver" wrote:
> >> >You need to set the
> >> >> >Mail.BodyFormat = MailFormat.Html
> >>
> >> Do you know if it can handle multi-part e-mails? What I mean is ones
> >> sent in both plain text and HTML. That way, the e-mail client being used
> >> can display whichever it feels (or the user has specified).
> >>
> >> Thanks.
> >>
> >> >(Assuming Mail is the name of your mail object).
> >> >> >Best regards,
> >> >Dave Colliver.
> >> >http://www.ManchesterFOCUS.com
> >> >~~
> >> >http://www.FOCUSPortals.com - Local franchises available
> >> >> >> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
> >> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> >> >> 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 text.
> >> >>
> >> >> What can I do?
> >> >> >>
> >> --
> >> Alan Silver
> >> (anything added below this line is nothing to do with me)
> >>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>Mail.BodyFormat = MailFormat.Html
>will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>No, the documentation will not tell you everything you need to know about
>email.
>"Alan Silver" wrote:
>> >Yes it does.
>>
>> OK, maybe I should have been a bit more specific with my question!!
>>
>> *How* do you do these types of e-mails? I couldn't see anything in the
>> SDK - which doesn't mean it's not there, just that I couldn't find it.
>>
>> TIA
>>
>> >"Alan Silver" wrote:
>>> >> >You need to set the
>> >>> >> >Mail.BodyFormat = MailFormat.Html
>> >>
>> >> Do you know if it can handle multi-part e-mails? What I mean is ones
>> >> sent in both plain text and HTML. That way, the e-mail client being used
>> >> can display whichever it feels (or the user has specified).
>> >>
>> >> Thanks.
>> >>
>> >> >(Assuming Mail is the name of your mail object).
>> >>> >> >Best regards,
>> >> >Dave Colliver.
>> >> >http://www.ManchesterFOCUS.com
>> >> >~~
>> >> >http://www.FOCUSPortals.com - Local franchises available
>> >>> >>> >> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
>> >> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>> >> >> 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 text.
>> >> >>
>> >> >> What can I do?
>> >>> >>> >>
>> >> --
>> >> Alan Silver
>> >> (anything added below this line is nothing to do with me)
>> >>
>>
>> --
>> Alan Silver
>> (anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
thanks everyone for the replies.
"Alan Silver" wrote:
Quote:
Originally Posted by
Quote:
Originally Posted by
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>
Quote:
Originally Posted by
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:
Quote:
Originally Posted by
Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
"Alan Silver" wrote:
You need to set the
Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.comwrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
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 text.
What can I do?
--
Alan Silver
(anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
>
Thursday, March 22, 2012
HTML Content Editor
cms system. It needs to be able to handle tables and graphics in a
non-technical way.
The best I've seen is at http://www.crossbowweb.net/Demo/
Can anyone tell me how I can develop something like this in asp.net?
John South
Pangbourne UKThe short answer from one who's been there is not easily but take a look at
msdn if you're sure that your users will use IE - do a search on 'html
editor' and you'll find some interesting stuff.
Joe
"John South" <jsouth@.cix.co.uk> wrote in message
news:d2aa22df.0312170113.5f9bb07e@.posting.google.c om...
> I'm looking to develop a simple content editor as part of an web-based
> cms system. It needs to be able to handle tables and graphics in a
> non-technical way.
> The best I've seen is at http://www.crossbowweb.net/Demo/
> Can anyone tell me how I can develop something like this in asp.net?
> John South
> Pangbourne UK
Wednesday, March 21, 2012
HTML Clean up
The idea was to save formatted html for each news article directly to the database, which is then displayed on the article table.
this idea worked fine, but unfortunatly people are using dreamweaver, ms word, and the like to create this html.
Needless to say, nearly 25,000 articles in my database by now, the article table alone grew to about 650MB (80% of the database!).
So I'm going to create a new component for them to create articles.
but, while doing so, I was wondering if there is something one can do, to loop through the database and "clean up" the html or something?
Worse case scenario, i will just leave the existing articles as is, and new articles will have simple html, with a single stylesheet for all articles.
Just would have like to clean up existing articles. That messy htlm, and huge record are crippling the search functionality.You will need to know what sort of 'extra' features these web editors add. You can then use a regex search to go through all the records and remove them (without removing the innertext). You could use SQL for this by directly manipulating the database.
Don't forget to try it on a backup first.
Html and Javascript inside the C# function
How to put html and JavaScript code into C# function?
eg:
private void ButtonLoad_Click(object sender, System.EventArgs e)
{
......
<html></html> <- how?
......
}Is register clientsidescript block helps you?
For info on it see below link!
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.asp?frame=true
Great Thanks :)