473,386 Members | 1,823 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 with asp.net (VB)

Hello!

Have made a mail procedure that works fine, but the mail is NOT sent in
HTML-format.
Someone who knows why this dont work?? Here is my code:
---------------------------------------------------------
Imports System.Web.Mail

Public Class subrutines

Public Shared Sub SendMail(ByVal inputTo As String, ByVal inputFrom As
String, ByVal inputSubject As String, ByVal inputBody As String)

Dim objMail As New MailMessage()
objMail.To = inputTo
objMail.From = inputFrom
objMail.BodyFormat = MailFormat.Html
objMail.Subject = inputSubject
objMail.Body = inputBody
SmtpMail.Send(objMail)

End Sub

End Class
----------------------------------------------------------

Thanks for all tips :)
Nov 19 '05 #1
2 920
Does inputBody include HTML markup ?

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Øyvind Isaksen" <oy****@webressurs.no> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
Hello!

Have made a mail procedure that works fine, but the mail is NOT sent in HTML-format.
Someone who knows why this dont work?? Here is my code:
---------------------------------------------------------
Imports System.Web.Mail

Public Class subrutines

Public Shared Sub SendMail(ByVal inputTo As String, ByVal inputFrom As String, ByVal
inputSubject As String, ByVal inputBody As String)

Dim objMail As New MailMessage()
objMail.To = inputTo
objMail.From = inputFrom
objMail.BodyFormat = MailFormat.Html
objMail.Subject = inputSubject
objMail.Body = inputBody
SmtpMail.Send(objMail)

End Sub

End Class
----------------------------------------------------------

Thanks for all tips :)

Nov 19 '05 #2
Yes, inputBody include HTML markup. But the mail will not have example bold
text, it is written like this: <b>text here>/b>....

I wonder why?


"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uY**************@TK2MSFTNGP09.phx.gbl...
Does inputBody include HTML markup ?

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Øyvind Isaksen" <oy****@webressurs.no> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
Hello!

Have made a mail procedure that works fine, but the mail is NOT sent in
HTML-format.
Someone who knows why this dont work?? Here is my code:
---------------------------------------------------------
Imports System.Web.Mail

Public Class subrutines

Public Shared Sub SendMail(ByVal inputTo As String, ByVal inputFrom As
String, ByVal inputSubject As String, ByVal inputBody As String)

Dim objMail As New MailMessage()
objMail.To = inputTo
objMail.From = inputFrom
objMail.BodyFormat = MailFormat.Html
objMail.Subject = inputSubject
objMail.Body = inputBody
SmtpMail.Send(objMail)

End Sub

End Class
----------------------------------------------------------

Thanks for all tips :)


Nov 19 '05 #3

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

Similar topics

3
by: GAT | last post by:
I have a e-mail function in serverside VB, how would i put html code in the body variable so when email is recieved it looks like html page in the body. right now it just shows up as text in the...
6
by: NetNoise | last post by:
Hi. I'm using CDO SYS to send email messages. I can attach a file just fine. However, I need to attach an HTML page that's generated on the fly by my ASP code. The attachment source code gets...
11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
17
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control...
4
by: Mattyw | last post by:
Hi, I have a WebForm that just consists of TextBoxes and Labels and I am wondering what would be the best way to send the WebForm as an HTML e-mail when the user clicks on a button event. I...
2
by: ChrisA | last post by:
I'm sending email from my ASP.NET 1.1 app, and it works fine providing the BodyFormat of the System.Web.Mail.MailMessage is set to Text. If I change to Html format, it breaks. Here's the code: ...
0
by: Rey | last post by:
Howdy all. Am using visual web developer 2005 (vb), xp pro sp2. In testing of the system.net.mail to send email from an aspx page where I'm pulling the email contents from a textbox, find that...
2
by: stew dean | last post by:
Hi, I'm a newbie so go easy. I'm having to covert an old site I've done to run in a .net environment and have limited time to do this. What I've learnt so far is the ideal way to do this is...
0
by: =?Utf-8?B?TWFyazEyMw==?= | last post by:
I have two pieces of VB.NET code below: a) Sends an email b) Returns a programmatically created jpeg image to a webpage. How can I embed the programmatically created jpeg into an HTML...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.