469,613 Members | 1,175 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

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 4690
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Alex Maghen | last post: by
1 post views Thread by WIzmanG | last post: by
11 posts views Thread by Ed Bitzer | last post: by
5 posts views Thread by Henry Stock | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.