Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email error notification

Status
Not open for further replies.

pinkpoppy

Programmer
Jul 6, 2011
75
0
0
US
I have an application in ASP.net that sends an email when an error occurs. In the email, it sends the subject line, then in the body, I have the error that occurred and the ID of the person.

In the body, it is sending this:
Invalid object name.4

I need something like this:

Error is: Invalid object name
ID: 4


I've tried doing this but it doesn't work also. Can anyone help me out?
emailerror.SendEmailError("An Error Occurred", "Error is: " + response + "ID: " + id);


I have the email class here:

Code:
        public void SendEmailError(string subject, string message)
        {
            try
            {
                string[] emailto = { "" }; 
                string[] emailfrom = { "" }; 
                string emailsubject = subject;
                string[] emailcc = null;
                string[] emailbc = null;
                string[] emailbody = { message };
                string[] emailatname = null;

                int attachcount = 0;
                byte[][] emailattach = new byte[attachcount][];

                TEST.MailService.MailServices MS = new Test.MailService.MailServices();

                string temp = MS.SendService(emailto, emailfrom, emailcc, emailbc, emailbody, emailatname, emailsubject, emailattach);

            }
            catch
            {
            }
        }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top