.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

putting carriage return/line feed in non-HTML email text

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
Using vb.net/asp.net 2005I am trying to create a string message for an email that I am sending out from my asp.net page like so: For Each dr In dtDataTable.Rows strMessage = strMessage & vbCrLf & vbCrLf & Environment.NewLine & dr.Item("UserName") & Environment.NewLine Next so I am looping through a datatable and getting each name from each row, that is working well but when I get the email it appears in my inbox with all the names mashed together, you see I am trying both vbcrlf and newline but looks like neither is workingdoes anyone know what I'm doing wrong?

View Complete Post

More Related Resource Links

SQL data type for HL7 message retaining carriage return and new line characters

Hi, What data type should be used for a column storing text as descripted in title? Please advise. I crrently have the message stored as text, but if I copy the message from studio management to a notepad, it will be come one big line of text instead.  

Mission Impossible? Use Javascript to Disable a Multi-Line Rich Text Field


Hey Community,

Here's a tough one that I have struggled with and so far have not been able to find an answer for - how do you use Javascript to disable a multi-line rich text field.  I have customized a SP Edit form by adding a CEWP.  In the CEWP I have added the Javascript below (only a partial code sample provided) to disable several fields in the form.  The code works fine for single line text fields but it does not work for multi-line rich text fields.  Any suggestions?

<script language="javascript">
//This runs the function when the form first loads

//This locks the fields the users should not modify
function lockFields()
  var theInputTFTitle = getTagFromIdentifierAndTitle("Input","TextField","Title");
  theInputTFTitle.readOnly = true;
  theInputTFTitle.style.color = 'gray';
  //alert(" Value: " + theInputTFTitle.value);//for testing

   var theInputDDLReplyStatus = getTagFromIdentifierAndTitle("select","DropDownChoice","Reply Status");
  theInputDDLReplyStatus.disabled = true;
  //alert(" Value: " + theInputDDLReplyStatus.value);//for testing

  var theInpu

Send HTML email with banner inside


Hi all,

I want to send html emails with one promo-banner inside. Have a look at my code... I try but with no success.


            Dim strFrom, strTo, strSubject, strBody As String
            Dim myMessage As MailMessage
            Dim mySmtpClient As SmtpClient
            strFrom = "SENDER<test@example.com>"
            strTo = Session("eemaill")
            strSubject = "HELLO THERE!"
            strBody = "HELLO THIS IS MY MSG<br />" + _
            " <script type='text/javascript'> var ai = 899; var rc = 40; var rt= 2; var rc_width = 724; var rc_height = 90; </script>" + _
            " <script type='text/javascript' src='http://assets.example.com/s/ads.js'></script><br /><br />" + _
            "<b>THANK YOU</b>"
            myMessage = New MailMessage(strFrom, strTo, strSubject, strBody)
            myMessage.IsBodyHtml = True
            mySmtpClient = New SmtpClient("mail.example.com")




Thank you

Putting a text box in typeover mode.


  I am using VB ASP.NET in Visual Studio 2008.  I would like to put some textboxes in typeover mode so that the user will not have to erase what is there before typing in the new text.

  Is there a way to do this?  If so, please direct me to the code examples or give me the code that can do this.

  Thank you for your time.

Extract text from html source code

i wan to extract Desired Title,Desired Text and Desired link from Webpage source code and paste in richTextBox1. <a href="/site/show/link/0/type/0">Desired Titl e</a> <a title="&lt;b&gt;Text preview&lt;/b&gt; &lt;br/&gt;Some Text" class="pdtip" href="/site/show/link/0/type/0">Text</a><br />Desired text <br /> <label class="url" for="">http://Desiredlink.com </label> Output: Desired Title Desired Title Desired link How can i do this?

.net 3.5 in conjunction with CRM 4.0 email router adding code to subject line of emails causing spam

We use CRM 4.0, which is using .net framework 3.5 SP 1.  Emails sent out of CRM go through and email router and the subject line of these emails is getting "=?us-ascii?Q? added to the beginning of the subject line and "?= added to the end of the subject line. This is causing a large amount of our emails getting spammed. I was told by the CRM support that this is an issue with .net 3.5 and won't be fixed until .net 4.0, which CRM won't support for another year.  Is there not a .net 3.5 patch that can address this?

Email task is not accepting the value from TO line

Hi. I'm trying to send an email to the TO: address in the following format "[Fax:blablalba@blablalba]" Send mail task tells me that the input string is in the incorrect format for email. How to skip this and send it out anyway? We have an Exchange server configured, which will send that type of email to the fax gateway. Thanks heaps, Kaarel.

Deleting Last Line of Text in a text file

Hi, I needed some help on the best way to delete the last line of  text in a text file. I have a subroutine that looks like this, but it is missing some code. Could anyone advise me on this? Dim strLogFile As String = System.Web.HttpContext.Current.Server.MapPath("~/Log.txt")         Dim fs As New FileStream(strLogFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None)         Dim swLog As New StreamReader(fs)         Dim array As String()         Dim value As String = swLog.ReadToEnd ''Array that holds the lines of the text file.         array = value.Split(vbCrLf)        ''code for deleting last line: . . .  fs.Close()

row.Cells[4].Text return nothing in GridView ?

I have a GridView in my page : <asp:GridView ID="GridView1" runat="server" AllowPaging="True" BackColor="White" AutoGenerateColumns="False" EmptyDataText="No data available." BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="729px" ForeColor="Black" GridLines="Vertical" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"> <RowStyle BackColor="#F7F7DE" /> <Columns> <asp:TemplateField HeaderText="TransactionKey" SortExpression="TransactionKey"> <EditItemTemplate> <asp:TextBox ID="TextBoxGridViewTransactionKey" runat="server" Text='<%# Bind("TextBoxTransactionKey") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LabelGridViewTransactionKey" runat="server" Text='<%# Bind("TextBoxTransactionKey") %>'></asp:Label> </ItemTemplate> <HeaderStyle Font-Size="14px" /> <ItemStyle Font-Size="12px" /> </asp:TemplateField> <asp:TemplateField He

How to eliminate html tags from text boxes

Hi all,   In my application I am using a login screen. While a new user registers he has to fill the First name and Last name. There is a user search option. The details of the users will be shown in the user details page. Some users try to add html tags like </td></tr> with first name and last name. So after rendering from DB the page alignment is breaking.   How to fix this problem??   How can I avoid html tags while entering the user details?   Please give me a solution:-   Thank You  

Showing highlighted text (HTML) in calculated field?

Greetings all,   We're porting our 2007 list to 2010. In Sharepoint 2007, we used the following Calculated Column code to display a highlight over items that had different statuses:   =IF(Date="","<DIV style='background-color:#ff6666'>Not <b>Yet</b> Set</DIV>", IF(Finalized=TRUE,"<DIV style='background-color:#66ff66'>Finalized</DIV>", "<DIV style='background-color:#fffa91'>Tentative</DIV>"))   When we use this in Sharepoint 2010, it doesn't seem to apply the DIV structure. Any ideas of how we can change our code to make this work? Thanks! --Dave   No matter -- I need to add a code snipped ( http://marijnsomers.blogspot.com/2010/01/write-html-code-in-sharepoint-via.html ) to the page... thanks!

howcan I get whole html request text from an external website ?

for example,There is a webpage html shows "Hello World" text only.howcan I get whole html request text from an external website ?I wantto get server request html text for parsing my own needles.webclient class seems doesnot working on localhost. any clue?   thanks.

Rich text field showing html code

I am an end user of Sharepoint. This issue only happens from my computer, not from any other within our organization. What happens is that when I edit an item in Sharepoint that contains a rich text field, HTML code is showing. Like so: <div class=ExternalClassC900CFF4F2BF4312A89133C01A6E3C96> Some text</div> This happens from any web browser. Sharepoint 2007 is used. I have Windows 7 x64. Any idea what is causing this?

Regex pattern for text extraction within html tag

Hi guys, ive originally posted this question in the "visual basic general" category and was forwarded here.   I am looking for the regex pattern for text extraction within this html tag  <span class="listingTitle">Inner Balance</span> This is the full link if its needed: http://www.yellowpages.ca/search/si/1/Estheticians/Calgary+AB Get I get some assistance please.

Query Sharepoint list, rich text columns returning HTML tags

Hi! So I have an issue that maybe someone of you have encountered as well. I am querying a Sharepoint list and creating a report from the data collected from this list. This all works fine except that one of the columns in this list is of the type "Multiple lines of text" and also supports "rich text" with different fonts, sizes and so on. This has the effect that the text returned from this column is wrapped in HTML tags that specifies how the text should be formatted. Naturally I do not want this HTML code to appear in my report so for now I have used custom code to do a string.replace and replaced for example <div></div> and <br> with "". However, this column also has url references to documents and these links shows up like this "/servername/site/subsite/Gemensamma%20dokument/Mwh.docx">http://servername/site/subsite/Gemensamma%20dokument/Mwh.docx There is some sort of double reference to the document that I guess like the HTML tags are embedded in the answer from the rich text column and this is not so easy to do a string replace on because the url varies with the different document and document names. My question really is if anyone of you have done a similar report that I am doing, and have encountered this fenomen with this sharepoint column and how you did to solve this? I have tried to creat

HtmlHelperExtensions in MVC2 return a HTML string, unencoded. In MVC3 this tring is encoded!

 HtmlHelperExtensions in MVC2 return a HTML string, unencoded. In MVC3 this string is encoded! How can I return unencoded HTML to a Razor view in MVC3? 

Inside Div text and background color not changing in HTML Tabs

there is below a I have Written a JAVAScript for TABS in HTML of div format and on anchor click the tab changes<script type="text/javascript"> function DisplayDiv(tabno){ var divnum; divnum=tabno; if(divnum == 1){ document.getElementById("div1").style.backgroundcolor="#D0DBF9"; document.getElementById("div2").style.backgroundcolor="#EFF3FE"; document.getElementById("div3").style.backgroundcolor="#EFF3FE"; document.getElementById("thisaudio").style.disply='block'; document.getElementById("comment").style.display='none'; document.getElementById("related").style.display='none'; } if(divnum == 2){ document.getElementById("div1").style.backgroundcolor="#EFF3FE"; document.getElementById("div2").style.backgroundcolor="#D0DBF9"; document.getElementById("div3").style.backgroundcolor="#EFF3FE"; document.getElementById("thisaudio").style.display='none'; document.getElementById("comment").style.display='block'; document.getElementById("related").style.display='none'; } if(divnum == 3){ document.getElementById("div1").style.backgroundcolor="#EFF3FE"; document.getElementById("div2").style.backgroundcolor="#EFF3F
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend