473,326 Members | 2,196 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,326 software developers and data experts.

HTML MailMessage issue

tma
It appears that even though my mailmessage.bodyformat is set to
mailformat.html, my html is being stripped out of the .body string in the
code below. Anyone have any thoughts on why this happens?

..From = "tommy@***.net"

..To = oApplicant.Email

..Bcc = ""

..Subject = "Registration Application"

..Body = EmailBody()

..BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "127.0.0.1"

SmtpMail.Send(mailMsg)

Just in case, this is the body text:

EmailBody = "<html><head><title>Registration
Confirmation</title></head><body><p>Thank you for registering with the ***.
Attached to this email are several important documents:<br><br> 1. <b>A copy
of your registration application </b> - Print this document and bring it to
you to the closest registration site. <b>You are not officially registered
until payment is made in full before the close of the registration period.
</b> Also included with your application are your registration agreements.
Please read them carefully.<br><br>2. <b>Parent's Guide</b> - This helpful
guide includes important dates, park rules and league rules with which you
should be familiar. If you have any questions, they are probably answered
here. <br><br>If you have registered for football and elected to rent
equipment from ***, you will need to pick up your equipment at the Please
do not forget to bring your child!<br><br>Thank you and we look forward to a
very exciting season at ***. </p><p></p></body></html>"


Nov 20 '05 #1
2 1136
Don't know if this is the issue for sure, but try setting the BodyFormat
property before the Body property.

"tma" <tm*@allisconfusing.net> wrote in message
news:uo*************@tk2msftngp13.phx.gbl...
It appears that even though my mailmessage.bodyformat is set to
mailformat.html, my html is being stripped out of the .body string in the
code below. Anyone have any thoughts on why this happens?

.From = "tommy@***.net"

.To = oApplicant.Email

.Bcc = ""

.Subject = "Registration Application"

.Body = EmailBody()

.BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "127.0.0.1"

SmtpMail.Send(mailMsg)

Just in case, this is the body text:

EmailBody = "<html><head><title>Registration
Confirmation</title></head><body><p>Thank you for registering with the ***. Attached to this email are several important documents:<br><br> 1. <b>A copy of your registration application </b> - Print this document and bring it to you to the closest registration site. <b>You are not officially registered
until payment is made in full before the close of the registration period.
</b> Also included with your application are your registration agreements.
Please read them carefully.<br><br>2. <b>Parent's Guide</b> - This helpful
guide includes important dates, park rules and league rules with which you
should be familiar. If you have any questions, they are probably answered
here. <br><br>If you have registered for football and elected to rent
equipment from ***, you will need to pick up your equipment at the Please
do not forget to bring your child!<br><br>Thank you and we look forward to a very exciting season at ***. </p><p></p></body></html>"

Nov 20 '05 #2
tma
I've actually tried it both ways.

"Marina" <so*****@nospam.com> wrote in message
news:OV**************@TK2MSFTNGP09.phx.gbl...
Don't know if this is the issue for sure, but try setting the BodyFormat
property before the Body property.

"tma" <tm*@allisconfusing.net> wrote in message
news:uo*************@tk2msftngp13.phx.gbl...
It appears that even though my mailmessage.bodyformat is set to
mailformat.html, my html is being stripped out of the .body string in the code below. Anyone have any thoughts on why this happens?

.From = "tommy@***.net"

.To = oApplicant.Email

.Bcc = ""

.Subject = "Registration Application"

.Body = EmailBody()

.BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "127.0.0.1"

SmtpMail.Send(mailMsg)

Just in case, this is the body text:

EmailBody = "<html><head><title>Registration
Confirmation</title></head><body><p>Thank you for registering with the ***.
Attached to this email are several important documents:<br><br> 1. <b>A

copy
of your registration application </b> - Print this document and bring it

to
you to the closest registration site. <b>You are not officially registered until payment is made in full before the close of the registration period. </b> Also included with your application are your registration agreements. Please read them carefully.<br><br>2. <b>Parent's Guide</b> - This helpful guide includes important dates, park rules and league rules with which you should be familiar. If you have any questions, they are probably answered here. <br><br>If you have registered for football and elected to rent
equipment from ***, you will need to pick up your equipment at the Please do not forget to bring your child!<br><br>Thank you and we look forward

to a
very exciting season at ***. </p><p></p></body></html>"


Nov 20 '05 #3

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

Similar topics

0
by: marc gold | last post by:
I am trying to create a send html functionality in a windows UI application. And using c# (of course) and the System.Web.Mail objects some sites work (aka www.microsoft.com) and some sites do not...
1
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
4
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP...
4
by: Jim in Arizona | last post by:
Now that I've figured out how to send mail within our domain: Dim test as new System.Net.Mail.SmtpClient Dim nco as New System.Net.NetworkCredential("mailaccount","password","domain")...
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: ...
1
by: Stu Lock | last post by:
Hi, I have an app that has beenusing the JMail COM component to generate emails. I would like to switch to the using the .Net 2.0 MailMessage object instead - as it is more portable. The...
7
by: Ray Booysen | last post by:
Hi all I'm sending email via ASP.NET in HTML mode. Each email has exactly one attachment and I do have full access to the SMTP server. However, if I send the email in HTML format, the...
2
by: =?Utf-8?B?Q2FwdGFpbiBEYXZlIQ==?= | last post by:
I wrote some code to send an email with two alternate views: 1) html 2) plain text All the html enabled email clients accept the html just fine and disregard the plain text version. However,...
2
by: anu b | last post by:
Now i am sending email to my friend using session variable... but my code is as below private bool SendEmail(string email) { try
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.