Click here to Skip to main content
15,879,037 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hello Folks, I am currently in the midst of a project featuring the use of asp and c# and one of the pages Ive been tasked to do is to create a sort of review page where the admin of sorts has the opportunity to look at changes and decide if they want to accept or decline, it works fine and the code is good but im looking to see if I can clean it up and make it more professional, basically when approve or decline button is clicked the change is made in the db but it only gives a label back saying its been approved or declined.

Is there anyway I can do something where it says your changes have been approved/ declined and click here to email the person and let them know? I aint sure how to do this or the code needed to email when they click here, I would want them to be able to email the person who has suggested the original change...

Im sorry if this sounds confusing but basically I would want to see if I can send an email to the person who was logged in and trying to make a change with a generic email saying change approved or declined..

Any help would be great...

Kind Regards RD
Posted
Comments
[no name] 29-Nov-15 21:49pm    
Can you provide what you've done so far so it can be adapted, This question is more of a "Do it for me" rather than a "Where can i improve this"

Of course you can send email in C#.

Please follow my past answer - sending email to gmail from asp.net[^].

This code is working perfectly, which uses Gmail as SMTP.

Please replace your email ids and passwords correctly and test.

In case you face any difficulty, please reply me.
 
Share this answer
 
Comments
Ryan Doyle 30-Nov-15 9:17am    
@Tadit Dash, is there anyway in which when the button is clicked, it sends the email to the person who is logged in, like how would it find the correct person logged in's email address if your following me?

Any help would be great..
RD
So, the logged in user and the user who is trying to send a mail are not the same?
When a person creates a review, are they required to login?

Also, how is the information stored? Is it in a database?

If it does, capture the operators contact detail and then you could have an event that says when it has been accepted, it looks to the original contact (Via a sql query) and then sends a template email out to that contact.
 
Share this answer
 
Comments
Ryan Doyle 30-Nov-15 13:03pm    
@Mendaharin- Yes its a user that logs in and creates the review, the person higher up i.e an admin can the decide weather to approve or decline changes, the datacomes from the db...

How would you go about doing that? I wouldnt really know where to start or where to add the code in to capture the user logged on, I know when the user logs on they log on via their email address so the one logged on would be the email address I would be looking to email to if you get me...
Mendaharin 30-Nov-15 18:21pm    
I'm not a dev (I'm just learning myself), but I can help with the logic and point you in the right direction. I work for a company that develops software so I go through the logic of it.

The easiest way I could think of doing it is to have a Boolean value within your database for accepted/declined. Then run a select query that works on the accepted/declined value. (You might also want to have date accepted, so that way it will only send on the current day or last week)

From there you would use that same select query to autofill the email you want to send. And then fire it off to an SMTP site. Tadits Gmail tutorial should help you with the email part.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900