Click here to Skip to main content
15,886,810 members

RTF to HTML (formatted HTML code)

SIFNOk asked:

Open original thread
Hi Everyone.

I have been developed a small smtp Windows application in vb.net, .net 4 framework. ihave read the following article How to Send Mails from your GMAIL Account through VB.NET or C#. Windows Programming, with a Bit of Customization[^], with a Bit of Customization[^] and used snippets of codes to get the main funcationality of the program.

An issue I am stuck with and I have searched multple places on the net with no luck, is I am using a richtextbox for the main message text box (txtmessge) but when I send the message in HTML view, it doesnt retain the formatting properties, is it achievable to have a message sent as it formatted in the richtextbox.

I have review many article with no success of an apporiate code they all seem to raise formatting issues.

Converting RTF to HTML in VB.NET the Easy Way[^]

And after previous post, Simon has informed me that Outlook 2007 on has changed its way it reads stylesheets.

Also be aware that outlook 2007 onwards has changed the ways that it reads HTML emails.

you will need to embed images rather than add them as HTML tag. Also they have changed the way that it reads StyleSheets.

microsoft breaks html email rendering in outlook[^]


I believe this is where the issue alies in the code:
VB
Dim htmlview As String
      Dim messagebyuser As String = txtmessage.Text
      Dim locateS As String = "C:\logo.jpg"
 htmlview = messagebyuser

or will I have to build the message into a html structure?

any help would be appericated. =)
Tags: Visual Basic

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900