Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with some code

Posted on 2012-04-05
7
Medium Priority
?
215 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 22

Accepted Solution

by:
plusone3055 earned 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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)…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 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