Solved

Help with some code

Posted on 2012-04-05
7
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

729 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