473,695 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

If I remove the line "MailObj.IsBody Html = 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(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click
if ispostback then
Dim MailObj As New System.Net.Mail .SmtpClient
EmFrom.Text="so *****@somewhere .com"
EmTo.Text="so** ***@somewhere.c om"
EmSubj.Text="Su bject Here"
EmMsg.Text="<b> Some html here....</b>"
MailObj.Host = "localhost"
MailObj.IsBodyH tml = True
MailObj.Send(Em From.Text, EmTo.Text, EmSubj.Text, EmMsg.Text)
end if
End Sub

Thanks
Leslie

Jul 24 '07 #1
1 5148
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("t e**@test.com", "Testing")
oSmtp = New System.Net.Mail .SmtpClient("sm tpout.test.com" )

oMail.From = oFrom
oMail.To.Add("t o**********@add ress.com")
oMail.Subject = "My subject"
oMail.Priority = Net.Mail.MailPr iority.Normal
oMail.IsBodyHtm l = False
oMail.Body = "<b>This is my message</b>"

oSmtp.Send(oMai l)
Cheers,
Johnny J.


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

If I remove the line "MailObj.IsBody Html = 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(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click
if ispostback then
Dim MailObj As New System.Net.Mail .SmtpClient
EmFrom.Text="so *****@somewhere .com"
EmTo.Text="so** ***@somewhere.c om"
EmSubj.Text="Su bject Here"
EmMsg.Text="<b> Some html here....</b>"
MailObj.Host = "localhost"
MailObj.IsBodyH tml = True
MailObj.Send(Em From.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
57652
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 unhandled by user code Message="Failure sending mail." Source="System" StackTrace: at System.Net.Mail.SmtpClient.Send(MailMessage message) at System.Net.Mail.SmtpClient.Send(String from, String
2
2157
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 SmtpClient(); SMTP.Send(Message); //Error happens here But the thing is, in my old use of System.Web.Mail, I never had this problem. Why do I HAVE to specify the host in the new version and I didn't
0
2402
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 when the SMTPClient attaches to the server and the server sends it greeting message, if anything other than +OK is received by the client it throws an exception and falls over.
2
4317
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 instatiates a new MailMessage object (see below) My form has the following code: Imports System.Net.Mail Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
2
6820
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 to fix this error. I am able to send messages sometimes both other times randomly following error appear EXCEPTION:
2
3214
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 this? Ive checked my bad mail folder, and other IIS similar folders and they're empty. Can the mail classes be used without having a SMTP server running on localhost? Can you use any smtp server that's capable of being set up from a PC, e.g. an ISP...
1
3272
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 error below, If I disable SSL and use port 587 all goes well. I have been Googling for 2 days without success and this seems to be a common problem.
11
3502
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 programs capabilities. Searching this forum I did not find any related information so if I have chosen poorly, I would appreciate a suggestion of a more appropriate dotnet forum. Now what I wish is the ability to send bcc's rather than to: (would be...
5
8320
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 by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: for the permission of type
0
8649
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9137
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8864
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8838
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7683
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6506
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5842
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.