473,473 Members | 2,215 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

BC30456: 'IsBodyHtml' is not a member of 'System.Net.Mail.SmtpClient'

les
I'm getting this error "BC30456: 'IsBodyHtml' is not a member of
'System.Net.Mail.SmtpClient'" when trying to submit a form and send
email.

If I remove the line "MailObj.IsBodyHtml = True" the mail sends
without error, but html markup is visible in the body of the email.

Any suggestions?

Code below:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
if ispostback then
Dim MailObj As New System.Net.Mail.SmtpClient
EmFrom.Text="so*****@somewhere.com"
EmTo.Text="so*****@somewhere.com"
EmSubj.Text="Subject Here"
EmMsg.Text="<b>Some html here....</b>"
MailObj.Host = "localhost"
MailObj.IsBodyHtml = True
MailObj.Send(EmFrom.Text, EmTo.Text, EmSubj.Text, EmMsg.Text)
end if
End Sub

Thanks
Leslie

Jul 24 '07 #1
1 5118
A small sample that works for me:

Dim oMail As System.Net.Mail.MailMessage
Dim oFrom As System.Net.Mail.MailAddress
Dim oSmtp As System.Net.Mail.SmtpClient

oMail = New System.Net.Mail.MailMessage
oFrom = New System.Net.Mail.MailAddress("te**@test.com", "Testing")
oSmtp = New System.Net.Mail.SmtpClient("smtpout.test.com")

oMail.From = oFrom
oMail.To.Add("to**********@address.com")
oMail.Subject = "My subject"
oMail.Priority = Net.Mail.MailPriority.Normal
oMail.IsBodyHtml = False
oMail.Body = "<b>This is my message</b>"

oSmtp.Send(oMail)
Cheers,
Johnny J.


"les" <le*@asasdad.comwrote in message
news:46*****************@msnews.microsoft.com...
I'm getting this error "BC30456: 'IsBodyHtml' is not a member of
'System.Net.Mail.SmtpClient'" when trying to submit a form and send
email.

If I remove the line "MailObj.IsBodyHtml = True" the mail sends
without error, but html markup is visible in the body of the email.

Any suggestions?

Code below:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
if ispostback then
Dim MailObj As New System.Net.Mail.SmtpClient
EmFrom.Text="so*****@somewhere.com"
EmTo.Text="so*****@somewhere.com"
EmSubj.Text="Subject Here"
EmMsg.Text="<b>Some html here....</b>"
MailObj.Host = "localhost"
MailObj.IsBodyHtml = True
MailObj.Send(EmFrom.Text, EmTo.Text, EmSubj.Text, EmMsg.Text)
end if
End Sub

Thanks
Leslie

Jul 24 '07 #2

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

Similar topics

3
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when sending the mail: System.Net.Mail.SmtpException was...
2
by: Alex Maghen | last post by:
I want to use the new System.Net.Mail instead of the old System.Web.Mail. I'm getting an error "Hot not specified" when I try to do my last two lines: System.Net.Mail.SmtpClient SMTP = new...
0
by: howardr101 | last post by:
Hi, Have hunted around on the groups and can't find anything, hence. I've tried this against 2 mail servers (mailtraq and hmailserver) and it occus with both. The problems seems to be that...
2
by: Tim | last post by:
I am trying to send a simple mail message using windows forms in VB.NET 2005. When executing the code, I get a general 'Configuration system failed to initialize' error message when the code...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
2
by: Claire | last post by:
I'm a noob at emailing from code and I need to add email capabilities to my application. The following code completes without exceptions but I'm not receiving any test emails. How do you debug...
1
by: WIzmanG | last post by:
Hi all I am having trouble with sending email via a C#2.0 application, I use the same settings as I use in Outlook but I cannot get email to send. I am trying to use SSL on port 465 and get the...
11
by: Ed Bitzer | last post by:
I have been able using the namespace System.Web.Mail and its method Smtp.mail.send to mail simple text messages to a small group within our 55 and older community. I need help expanding the...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.