Hi,
I am working with asp.net and SQL Server..
Now, I have an email sent out with the code below;
Works Fine..
The problem is <%requirement%> - the code doesnt recognise a space or a break.. instead it joins the entire saved text as one paragraph..
E.g:
Good afternoon.
My name is "John Smith" and I really need you help on this.
Thank you
Email will be;
Good afternoon.My name is "John Smith" and I really need you help on this.Thank you
On the email template I have;
How can i enforce the format as requested. Because in SQL Server the data is saved with spaces and breaks.
Thank you
I am working with asp.net and SQL Server..
Now, I have an email sent out with the code below;
Code:
Private Sub Authorsendemail()
Using message As New MailMessage()
'Dim msgbody As String = String.Empty
Dim htmlFile As String = Server.MapPath("~/EmailTemplate/NewChangeRequest.htm")
Dim sreader As New StreamReader(htmlFile)
Dim msgBody As New StringBuilder(sreader.ReadToEnd)
sreader.Close()
msgBody.Replace("<%reference%>", Trim(txtref.Text.ToString()))
msgBody.Replace("<%author%>", Trim(cmbchngcrt.SelectedItem.ToString()))
msgBody.Replace("<%requirement%>", Trim(txtreq.Text.ToString()))
message.From = New MailAddress(findemail(cmbchngcrt.SelectedItem.ToString))
message.[To].Add(New MailAddress(findemail(cmbpeername.SelectedItem.ToString)))
message.[CC].Add(New MailAddress(findemail(cmbchngcrt.SelectedItem.ToString)))
message.Subject = "Change Request Enquiry: " + Trim(txtref.Text.ToString())
message.IsBodyHtml = True
message.Body = msgBody.ToString
Dim client As New SmtpClient()
client.Send(message)
sreader.Dispose()
End Using
End SubThe problem is <%requirement%> - the code doesnt recognise a space or a break.. instead it joins the entire saved text as one paragraph..
E.g:
Good afternoon.
My name is "John Smith" and I really need you help on this.
Thank you
Email will be;
Good afternoon.My name is "John Smith" and I really need you help on this.Thank you
On the email template I have;
Code:
<div id="content">
<h3> Change Control Request - Review </h3>
<p> I have submitted a change control request <b>Ref:
<%reference></b>) <br />
Please <a href="http://www.test.com">click here</a> to log on to the System to review and agree the request.
</p>
<p>
<b>See the details below:</b>
<br /><%requirement%>
</p>
<p>This is an automated message from the CCMS.</p>
<p>Thank you, <br />
<%author%></p>
</div>Thank you