Solved

Help with some code

Posted on 2012-04-05
7
201 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:daiwhyte
7 Comments
 
LVL 9

Expert Comment

by:wasiftoor
ID: 37810602
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!
0
 

Author Comment

by:daiwhyte
ID: 37810798
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.
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 37811560
Please find attached today's report &  vbCrLf  &   "Key for Status" & vbCrLf & ect & vbCrLf & ect
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 37811578
"Please find attached today's report." & vbCrLf & "Key for Status" & vbCrLf & "ect" & vbCrLf

Or if this is using ASP.NEt just make a web control txt File
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 37811601
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)
0
 
LVL 12

Expert Comment

by:Anuradha Goli
ID: 37815702
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"
0
 

Author Closing Comment

by:daiwhyte
ID: 37837078
Worked a charm. Thanks
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now