daiwhyte
asked on
Help with some code
Hi All,
Ive got a application which was written by a developer who has long left the company. Im not a coder but Ive been able to muddle my way through various changes over the past couple of year but today, Ive come up against something which I thought would be a piece of cake but alas its not.
The application in question runs a serious of reports and emails them out to a user. The email body has the text "Please find attached today's report". I want to change this so it says the following:-
Please find attached today's
Status Key
ENQ - Enquiry Received
APP - Application Passed to Underwriting
SEL - Ready to Sell
SLD - Loan Sold
ROI - Regulated Offer Issued
UOI - Unregulated Offer Issued
RCE - Regulated Consideration Expired
WIP - Work in Progress
PPO - Pending Payout
SLC - Secured Loan Completion
REJ - Application Rejected
TUD - Customer Turned Us Down
TPD - Third Party Deal
DUP - Duplicate lead received within 30 days
Now, Ive opened up the code in VB Studio and Ive found the line which inserts the "Please find attached todays report" and Ive appended the string to include all the rest of what I want included in the email body. When I do this, in the error list of the VB Studio I see loads of new errors so I guess Im not able to insert the additional text.
SendOutEmail(strEmailSende r, strEmailList.ToString, _
String.Concat(strSelectedR eport.Subs tring(strS electedRep ort.LastIn dexOf("\") + 1), " - ", _
arrSourceCodesList(intNumb erOfSource s)), "Please find attached today's report.", arrFileList) ' -- Send mail
How would I get the email body string updated to include my extra text?
Ta
D
Ive got a application which was written by a developer who has long left the company. Im not a coder but Ive been able to muddle my way through various changes over the past couple of year but today, Ive come up against something which I thought would be a piece of cake but alas its not.
The application in question runs a serious of reports and emails them out to a user. The email body has the text "Please find attached today's report". I want to change this so it says the following:-
Please find attached today's
Status Key
ENQ - Enquiry Received
APP - Application Passed to Underwriting
SEL - Ready to Sell
SLD - Loan Sold
ROI - Regulated Offer Issued
UOI - Unregulated Offer Issued
RCE - Regulated Consideration Expired
WIP - Work in Progress
PPO - Pending Payout
SLC - Secured Loan Completion
REJ - Application Rejected
TUD - Customer Turned Us Down
TPD - Third Party Deal
DUP - Duplicate lead received within 30 days
Now, Ive opened up the code in VB Studio and Ive found the line which inserts the "Please find attached todays report" and Ive appended the string to include all the rest of what I want included in the email body. When I do this, in the error list of the VB Studio I see loads of new errors so I guess Im not able to insert the additional text.
SendOutEmail(strEmailSende
String.Concat(strSelectedR
arrSourceCodesList(intNumb
How would I get the email body string updated to include my extra text?
Ta
D
ASKER
I want the text to look like this
Please find attached today's report
Key for Status
etc
etc
etc
etc
The trouble is,when hiit return after the word "report" so I start a new line, I get errors on the error list.
If I just add to the existing string and not hit enter, Im able to insert text but this wont look right in the email body.
Please find attached today's report
Key for Status
etc
etc
etc
etc
The trouble is,when hiit return after the word "report" so I start a new line, I get errors on the error list.
If I just add to the existing string and not hit enter, Im able to insert text but this wont look right in the email body.
Please find attached today's report & vbCrLf & "Key for Status" & vbCrLf & ect & vbCrLf & ect
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
simple waty to do this would be...
Create a new text file to the App_data folder on your website
name it Emailbody.txt
in the txtfile enter the body you want
Please find attached today's report
Key for Status
etc
etc
etc
etc
then in your code with the email
If Page.IsValid Then
Dim fileName As String = Server.MapPath(“~/App_Data /Emailbody .txt”)
Dim mailBody As String = System.IO.File.ReadAllText (fileName)
Create a new text file to the App_data folder on your website
name it Emailbody.txt
in the txtfile enter the body you want
Please find attached today's report
Key for Status
etc
etc
etc
etc
then in your code with the email
If Page.IsValid Then
Dim fileName As String = Server.MapPath(“~/App_Data
Dim mailBody As String = System.IO.File.ReadAllText
SendOutEmail(strEmailSende r, strEmailList.ToString, _
String.Concat(strSelectedR eport.Subs tring(strS electedRep ort.LastIn dexOf("\") + 1), " - ", _
arrSourceCodesList(intNumb erOfSource s)), "Please find attached today's report.", arrFileList) ' -- Send mail
Replace "Please find attached today's report." with
String.Concat(strSelectedR
arrSourceCodesList(intNumb
Replace "Please find attached today's report." with
"Please find attached today's report. \n Key for Status \n"
or
"Please find attached today's report."& vbCrLf &"Key for Status"
ASKER
Worked a charm. Thanks
"Please find attached today's report. Your new Text here"
Otherwise you if your text is part of a variable String you can concatenate it as
"Please find attached today's report." & varNewstring.
Good Luck!