Link to home
Start Free TrialLog in
Avatar of daiwhyte
daiwhyteFlag for United Kingdom of Great Britain and Northern Ireland

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(strEmailSender, strEmailList.ToString, _
                    String.Concat(strSelectedReport.Substring(strSelectedReport.LastIndexOf("\") + 1), " - ", _
                    arrSourceCodesList(intNumberOfSources)), "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
Avatar of wasiftoor
wasiftoor
Flag of United States of America image

If your text is a static statement you can just but that along with the "Please find attached ....." statement. Within in the quotes (" ") as shown below

"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!
Avatar of daiwhyte

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 &  vbCrLf  &   "Key for Status" & vbCrLf & ect & vbCrLf & ect
ASKER CERTIFIED SOLUTION
Avatar of plusone3055
plusone3055
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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)
SendOutEmail(strEmailSender, strEmailList.ToString, _
                    String.Concat(strSelectedReport.Substring(strSelectedReport.LastIndexOf("\") + 1), " - ", _
                    arrSourceCodesList(intNumberOfSources)), "Please find attached today's report.", arrFileList) ' -- Send mail


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"
Worked a charm. Thanks