E
edwardwill
ASP.NET
I have a function on my aspx page to format an email message and send
it. The function is below.
The problem is that I want the body to be formatted with CR/LF -
newlines - between the CS No, the Customer Reference No. and the
body. E.g.
CSNo: ABC123
Customer Ref: 321321
This is the body of the text
What my function gives me when I look at the email message in the mail
client (Outlook) is
CS No: ABC123Customer Ref: 321321This is the body of the text
In other words, no carriage returns.
Any thoughts?
Thanks
Edward
function BuildEmailResponse(id)
{
try
{
var gridrowindex;
if (!(oRow = GetRow(window.event.srcElement))) return true;
gridrowindex = oRow.rowIndex + 2;
var editcontrolprefix = "dgSearch__ctl" + gridrowindex + "_";
var oEmailAddress =
document.getElementById('txtContactEmail').value;
var oSubject =
document.getElementById('txtSubject').value;
if (oSubject.length == 0)
{
oSubject = "[Blank]";
}
var oBody = 'CS No: ' + document.getElementById('txtCSNo').value +
'\r\n';
oBody += 'Customer Ref: ' +
document.getElementById('txtCustomerRef').value + '\r\n';
oBody += document.getElementById(editcontrolprefix +
'txtResponse').value;
document.getElementById(id).href = "mailto:" + oEmailAddress + "?
subject=" + oSubject + "&body=" + oBody
}
catch(e)
{
document.getElementById(id).href = "mailto:" + oEmailAddress + "?
subject=" + oSubject
}
}
I have a function on my aspx page to format an email message and send
it. The function is below.
The problem is that I want the body to be formatted with CR/LF -
newlines - between the CS No, the Customer Reference No. and the
body. E.g.
CSNo: ABC123
Customer Ref: 321321
This is the body of the text
What my function gives me when I look at the email message in the mail
client (Outlook) is
CS No: ABC123Customer Ref: 321321This is the body of the text
In other words, no carriage returns.
Any thoughts?
Thanks
Edward
function BuildEmailResponse(id)
{
try
{
var gridrowindex;
if (!(oRow = GetRow(window.event.srcElement))) return true;
gridrowindex = oRow.rowIndex + 2;
var editcontrolprefix = "dgSearch__ctl" + gridrowindex + "_";
var oEmailAddress =
document.getElementById('txtContactEmail').value;
var oSubject =
document.getElementById('txtSubject').value;
if (oSubject.length == 0)
{
oSubject = "[Blank]";
}
var oBody = 'CS No: ' + document.getElementById('txtCSNo').value +
'\r\n';
oBody += 'Customer Ref: ' +
document.getElementById('txtCustomerRef').value + '\r\n';
oBody += document.getElementById(editcontrolprefix +
'txtResponse').value;
document.getElementById(id).href = "mailto:" + oEmailAddress + "?
subject=" + oSubject + "&body=" + oBody
}
catch(e)
{
document.getElementById(id).href = "mailto:" + oEmailAddress + "?
subject=" + oSubject
}
}