473,320 Members | 1,950 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,320 software developers and data experts.

Question about sending email via Visual Basic 2005 on a ASP.NET pa

Hello everyone-

I am hoping a couple of you will have some ideas on this one...

I have a webform created in visual basic 2005.
Basically, the webform gather answers to the questions asked on the form and
included a couple free type multine textboxes.

When the user presses submit an message is created with the responses and
fired off to a MS Exchange mail enabled public folder.

This is an external webform btw, not used by internal users.

Problem:
After some fighting, I have the mail message formatted pretty as it was
requested and I have it coming in HTML form: MailMessage.IsBodyHtml = True
For the most part.

My hang up is the couple free text multi line text boxes don't word wrap so
well (all the time).
When I view them, using MS Outlook 2007 those sections word wrap just fine
in the public folder post. However, are admins in the other sections, using
MS Outlook 2003, do not show the word wrap.

Outlook 2007 on my pc and Outlook 2003 on their pc are set to view messages
in HTML mode. As far as I can tell, other then being different versions -
are settings are similar.

Not sure if there is something I could do programmatically to get around
this issue or not?

Again, everything seems great - except those couple multiline text box
objects....

I tried playing around with the html <PREtags and that didn't even help.

I been digging through blogs and other posts for about 2 hours now - no luck.

Anyone have any ideas?

Apr 30 '07 #1
5 1463
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discussions.microsoft.comwrote:
Hello everyone-

I am hoping a couple of you will have some ideas on this one...

I have a webform created in visual basic 2005.
Basically, the webform gather answers to the questions asked on the form and
included a couple free type multine textboxes.

When the user presses submit an message is created with the responses and
fired off to a MS Exchange mail enabled public folder.

This is an external webform btw, not used by internal users.

Problem:
After some fighting, I have the mail message formatted pretty as it was
requested and I have it coming in HTML form: MailMessage.IsBodyHtml = True
For the most part.

My hang up is the couple free text multi line text boxes don't word wrap so
well (all the time).
When I view them, using MS Outlook 2007 those sections word wrap just fine
in the public folder post. However, are admins in the other sections, using
MS Outlook 2003, do not show the word wrap.

Outlook 2007 on my pc and Outlook 2003 on their pc are set to view messages
in HTML mode. As far as I can tell, other then being different versions -
are settings are similar.

Not sure if there is something I could do programmatically to get around
this issue or not?

Again, everything seems great - except those couple multiline text box
objects....

I tried playing around with the html <PREtags and that didn't even help.

I been digging through blogs and other posts for about 2 hours now - no luck.

Anyone have any ideas?
I might embarrass myself with this on-the-fly Regex pattern, but here
it goes:

You could use regex to match the text in each line of the multiline
textbox, then add a <br /tag to the end of each line.

This assumes an Imports System.Text.RegularExpressions:

' This is typed in the message so it may contain errors

Dim output as String = ""
For Each m as Match in Regex.Matches(me.TextBox1.Text, "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Multiline))
output &= String.Format("{0}<br />", m.Value)
Next
' Then just use the "output" string in your email

Thanks,

Seth Rowe

Apr 30 '07 #2

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discussions.microsoft.comwrote:
>Hello everyone-
You could use regex to match the text in each line of the multiline
textbox, then add a <br /tag to the end of each line.

This assumes an Imports System.Text.RegularExpressions:

' This is typed in the message so it may contain errors

Dim output as String = ""
For Each m as Match in Regex.Matches(me.TextBox1.Text, "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Multiline))
output &= String.Format("{0}<br />", m.Value)
Next
' Then just use the "output" string in your email
Perhaps I didn't fully understand the question, but I'm doing something
similar myself and what worked for me was to simply scan for vbcrlf in the
textbox text and then replace with both a duplicate vbcrlf and a <brtag.
I'm still new to email creation, but this seems to permit the proper viewing
by both html enabled email software that seems to ignore the vbcrlf and by
plain-text only software the ignores the html tags.

It is similar in function to the above, but much easier to code. My code is
below

Msg = Replace(Msg, vbCrLf, vbCrLf & "<br>")

Jeff


--
Posted via a free Usenet account from http://www.teranews.com

May 1 '07 #3
Seth-

Thank you for the info!

I did a test and the regular expression road you pointed me down does work,
but I initally tried to steer clear of regular expressions due to the
difficulty in someone else just taking a look at it later and being able to
easily read it.

I choose another option, giving up perhaps the better way for readability.

I know regular expressions is probably the best way and I need get more
familar with them, but perhaps I will drive that road in another couple
months.

Thanks-

Tony Wissler

"rowe_newsgroups" wrote:
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discussions.microsoft.comwrote:
Hello everyone-

I am hoping a couple of you will have some ideas on this one...

I have a webform created in visual basic 2005.
Basically, the webform gather answers to the questions asked on the form and
included a couple free type multine textboxes.

When the user presses submit an message is created with the responses and
fired off to a MS Exchange mail enabled public folder.

This is an external webform btw, not used by internal users.

Problem:
After some fighting, I have the mail message formatted pretty as it was
requested and I have it coming in HTML form: MailMessage.IsBodyHtml = True
For the most part.

My hang up is the couple free text multi line text boxes don't word wrap so
well (all the time).
When I view them, using MS Outlook 2007 those sections word wrap just fine
in the public folder post. However, are admins in the other sections, using
MS Outlook 2003, do not show the word wrap.

Outlook 2007 on my pc and Outlook 2003 on their pc are set to view messages
in HTML mode. As far as I can tell, other then being different versions -
are settings are similar.

Not sure if there is something I could do programmatically to get around
this issue or not?

Again, everything seems great - except those couple multiline text box
objects....

I tried playing around with the html <PREtags and that didn't even help.

I been digging through blogs and other posts for about 2 hours now - no luck.

Anyone have any ideas?

I might embarrass myself with this on-the-fly Regex pattern, but here
it goes:

You could use regex to match the text in each line of the multiline
textbox, then add a <br /tag to the end of each line.

This assumes an Imports System.Text.RegularExpressions:

' This is typed in the message so it may contain errors

Dim output as String = ""
For Each m as Match in Regex.Matches(me.TextBox1.Text, "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Multiline))
output &= String.Format("{0}<br />", m.Value)
Next
' Then just use the "output" string in your email

Thanks,

Seth Rowe

May 2 '07 #4
Jeff-

Thanks for the info, I gave this a try and it worked great for what I wanted
to do.
The formatting looks good now in both MS Outlook 2007 and MS Outlook 2003.

Regular Expressions is probably the best way (as mentioned above), but I
went this route for ease of readability and I am not concerned about speed on
this particular web form as I don't see the traffic being that extreme.

Thanks-

Tony Wissler

"Jeff" wrote:
>
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discussions.microsoft.comwrote:
Hello everyone-
You could use regex to match the text in each line of the multiline
textbox, then add a <br /tag to the end of each line.

This assumes an Imports System.Text.RegularExpressions:

' This is typed in the message so it may contain errors

Dim output as String = ""
For Each m as Match in Regex.Matches(me.TextBox1.Text, "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Multiline))
output &= String.Format("{0}<br />", m.Value)
Next
' Then just use the "output" string in your email

Perhaps I didn't fully understand the question, but I'm doing something
similar myself and what worked for me was to simply scan for vbcrlf in the
textbox text and then replace with both a duplicate vbcrlf and a <brtag.
I'm still new to email creation, but this seems to permit the proper viewing
by both html enabled email software that seems to ignore the vbcrlf and by
plain-text only software the ignores the html tags.

It is similar in function to the above, but much easier to code. My code is
below

Msg = Replace(Msg, vbCrLf, vbCrLf & "<br>")

Jeff


--
Posted via a free Usenet account from http://www.teranews.com

May 2 '07 #5

"Tony Wissler" <To*********@discussions.microsoft.comwrote in message
news:93**********************************@microsof t.com...
Jeff-

Thanks for the info, I gave this a try and it worked great for what I
wanted
to do.
The formatting looks good now in both MS Outlook 2007 and MS Outlook 2003.

Regular Expressions is probably the best way (as mentioned above), but I
went this route for ease of readability and I am not concerned about speed
on
this particular web form as I don't see the traffic being that extreme.

Thanks-

Tony Wissler

Umm, the first time that I successfully actually answered a question for
someone else rather than the other way around.

I must be learning something - it's a scary thought.

Jeff
--
Posted via a free Usenet account from http://www.teranews.com

May 2 '07 #6

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

Similar topics

13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
4
by: Mark | last post by:
Hi Forum, I'm new to ASP.NET and have a basic question. If someone is willing to lay it out for me in an easy way to understand, I have a huge list of tasks I'm willing to pay to get...
2
by: elnahrawi | last post by:
Download ebook http://books-download.com/?Book=1487-Visual+Basic+2005+Jumpstart Okay, all you VB6 developers--time's up. As of March 2005, Microsoft no longer supports this version of Visual...
4
by: MikeB | last post by:
I've been all over the net with this question, I hope I've finally found a group where I can ask about Visual Basic 2005. I'm at uni and we're working with Visual Basic 2005. I have some books, ...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
2
by: tele | last post by:
Hi. I understand Microsoft has VB 2005 Express available for download. I want to know if there is a standard version of Visual Basic 2005? If it's in the Visual Studio studio suite, then which one?...
11
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have seen the terms Visual Basic 2005 and VB.NET. It seems that sometimes they seem to be referring to the same thing but sometimes they are not. I also run into terms like VB9 and VB10.
1
by: sasnien | last post by:
Hello All, I have an Access '97 application that I currently have mail enabled and sending properly. However, I want to add functionality to effectively create a 30 day tickler, that would walk...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.