How to get the users SMTP Server credentials to send an email from the users email in C# - c#

I have been trying to figure out how to send an email from the users email for this C# application that is being sent to my company's venders. it creates a unique xml file for the users to send our company. the users email is the determining factor if the xml file gets in our system and tells us where it goes.
I tried to use the mailto but that won't allow attachments to be passed through.
I am at a bit of a loss here.

Related

c# : Approve / Reject through eMail : Not Buttons : Minimal Clicks

I have developed an application, which has got an approval flow. The application approval / reject is working fine and I have been tasked with developing a solution for approval through emails, instead of the users log in on to the application, which anyway uses domain credentials. The application is hosted locally, allowed locally only, and is not published onto any public IPs. This requirement of mail approvals are for Management approvals, who are on the move most of the time and will not be agreeing to go for a VPN Access of the said application.
So far I developed a solution which sends an eMail to the approval authority with 2 URLs (one for approve and other for reject). When the recipient of the mail clicks on the relevant link the action is updated in the database. Until here everything was tested and working fine.
Now in case the mail is forwarded by the authorized approver to a different email ID, they secondary recipient also will be able to click on the relevant links and get the database updated which is not the intended functionality since the secondary recipient is not an authorized approver.
Any suggestions on how to control this are desired.
Edit 1
To the 2 URLs I am sending in mail, I am adding a query string, which is a unique identifier associated with the approval authority ID.
However, if the same mail is forwarded to a secondary recipient, I am not sure on how to validate the eMail ID from which the click originated.
Edit 2
I have tried the suggestions (given in the comments below ). I have generated the mail with Request ID in the subject of the mail and requested the users to reply to that mail with only one word in body either Approve / Reject. I have ensured that the application shall process it in a case insensitive way. However, there were so many typos for one word that I could not imagine the number of combinations I had to cope up with.
I have also tried, having the Request ID in the subject of the mail, and requested the users to reply to that mail by appending either : A for approve or : R for reject (case insensitive). But this again resulted in numerous typos.
You have basically two options
have your users reply to the email with Accept or Reject like you said. In this case, you will have to validate whether the email account in the FROM field has the right to do so.
have your user click a link. In this case, you will HAVE to make the application validate the user based on his login credentials.
There is no other way to go about this. You either have to validate the email sender, or the person has to be logged in to the application. There is no other mechanism available in this scenario.
There might be different ways of implementing these two options, but those are the only options you have.

How to use an external domain in the From field when programatically sending email using Exchange Online?

Sending emails from Exchange Online on behalf of another user seems to be possible from our own domains but what about sending an email with a from address in a completely external domain? Is this completely forbidden by Microsoft or are there some ways to achieve this programmatically?

linking a received email with a sent email

I have just completed reading received and sent emails using c# console application well that was easy part now the problem is I wanted to know is there a way of linking a received email to its replied/sent email like lets say i create a streamwriter and I write the contents that I need from the received email and the contents from the replied/sent email. How would I then go about knowing the received email to its replied/sent email? How would I link them? Uniquely differentiate from the tons of email?

How pull GAL of a different mailbox (Exchange) in Outlook or develop an outlook Add-in to do that

The company I work for is a contractors for a large organisation with thousands and thousands of users. This organisation have setup some mailboxes for us to access their GAL (Global Address Book).
Although we need access to this GAL but at the same time we do not want our users to start using their mailboxes.
So I am trying to find a way to setup outlook 2013 in such a way that users can search this GAL but are not able to send or receive email from this mailbox.
Note: we only have email addresses and passwords no access to their Exchange server.
One of the idea I had was to develop an outlook add-in which searches this GAL and allow the user to add the email address into the To or CC box of the message being composed but I have no idea where to start or even if it’s possible without access to Exchange server.
I would highly appreciate if some one can steer me to the right direction.
The only thing I can think of to prevent users from being able to send or receive mail would be to set their send receive limit to like 1KB:
Get-Mailbox user | Set-Mailbox -ProhibitSendReceiveQuota 1KB

How do I enable users to send email from ASP.NET MVC?

I'm developing a web application in ASP.NET MVC, and I want users to be able to click on a new link and have it send an email through their default email client with information already filled in, how do I do this?
How would I do it if I wanted an email to be sent out when a new ticket was submitted in the help system?
From MSDN:
<a href="mailto:user#example.com?
subject=MessageTitle&
body=Message Content">
Contact Us</a>
If you wanted to send this email to all users of your application, you'd probably need to automate that part into a service that sends email automatically. You can send email through .NET without any interaction from the user.
Without having the particulars, I see you could do it as follows:
User adds Ticket to the database.
Asynchronous Service polls database for changes to that table.
When it encounters a new ticket, sends an email to a list of users using information from this Stack Overflow question.
The list of users would come from the database, or whatever mechanism you have in place to authenticate and authorize users. If it's Active Directory, it would come from members of that group.
Update
If the user wants to share that email with others, then why not let them pick who they want to share it with in Outlook?
At that point, you can leave off the email address and they can choose it when it pops up in their email editor:
Contact Us
That produces the following when you click on the link:

Categories