473,761 Members | 8,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.IsB odyHtml = 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 programmaticall y 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 1482
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discuss ions.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.IsB odyHtml = 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 programmaticall y 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.Reg ularExpressions :

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

Dim output as String = ""
For Each m as Match in Regex.Matches(m e.TextBox1.Text , "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Mu ltiline))
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_newsgroup s" <ro********@yah oo.comwrote in message
news:11******** **************@ l77g2000hsb.goo glegroups.com.. .
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discuss ions.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.Reg ularExpressions :

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

Dim output as String = ""
For Each m as Match in Regex.Matches(m e.TextBox1.Text , "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Mu ltiline))
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_newsgroup s" wrote:
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discuss ions.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.IsB odyHtml = 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 programmaticall y 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.Reg ularExpressions :

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

Dim output as String = ""
For Each m as Match in Regex.Matches(m e.TextBox1.Text , "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Mu ltiline))
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_newsgroup s" <ro********@yah oo.comwrote in message
news:11******** **************@ l77g2000hsb.goo glegroups.com.. .
On Apr 30, 1:54 pm, Tony Wissler <Tony
Wiss...@discuss ions.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.Reg ularExpressions :

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

Dim output as String = ""
For Each m as Match in Regex.Matches(m e.TextBox1.Text , "(?=[^\r
\n]).*(?<![\r\n])", RegexOptions.Mu ltiline))
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*********@di scussions.micro soft.comwrote in message
news:93******** *************** ***********@mic rosoft.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
3229
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 this, it seems, that the user must install IIS on their computer. Isn't there a class that will detect whatever mail server is available on a computer and use that? How do I create this functionality without having the user add any other...
4
1150
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 completed... please help. Quick background... I've got three books on ASP.NET web app development. If I follow the code, I have no problem manually creating a Connect, and sending a Command, getting a Data Set and binding and all that good stuff.
2
1511
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 Basic. And you can't blame them. Three years ago, they introduced the .NET Framework--an elegant, powerful platform--along with the new component-based VB.NET language. But roughly five million of you decided to stick with VB6, mostly to maintain...
4
1731
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, - Programming Visual Basic by Balena (MS Press) and - Visual Basic 2005 by Willis (WROX), but they don't go into the forms design aspects and describing the various controls at all. What bookscan I get that will cover that?
4
2161
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 problem. Can they not just post the fix. I see no reason to contact MS since I have most likely sent about 1500 dumps to them and I would think this would get their attention.
2
1114
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? I'm just confused with the Visual Studio and .NET lingo. I just want to know where the latest Visual Basic programming languages are. Thanks.
11
2297
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
2113
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 the end-user through the process of creating the memo, but not send the email until 30 days from the current date. I can't seem to find any property that would (hopefully) mimic this capability. I am familiar with the basic .subject, .to,...
0
9554
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
10136
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
9923
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
9811
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
8813
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
7358
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
5266
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
3911
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
3
2788
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.