Reputation: 643
We need to setup a mechanism of receiving email of a particular Account of a Domain, Just like normal ticketing system reply emails.
Found some of the sources of how it could be achieved.
Either Go For Custom Solution
https://github.com/jstedfast/MailKit
https://joshwright.com/tips/tips-sending-receiving-email-in-csharp/
Send Grid Web Hooks
The Other Ready to go solution is Send Grid, but the problem with send grid is it monitors each and every email of domain, i can filter them at my end but still it doesn't seem good approach keeping the security prospect in mind. Here our Approach could be , can create a sub domain under the domain and receive those emails
I am currently using send grid for sending emails
Looking forward , what could the best, reliable and scalable approach and the pros and corns of it.
Upvotes: 3
Views: 1804
Reputation: 8063
Simply write a C# program to receive emails of that particular box as follows:
var client = new POPClient();
client.Connect("pop.gmail.com", 995, true);
client.Authenticate("[email protected]", "YourPasswordHere");
var count = client.GetMessageCount();
// use a for loop to get the subject / message
Message message = client.GetMessage(count);
Console.WriteLine(message.Headers.Subject);
// message.Headers.From.Address;
// from address
// messagePart.BodyEncoding.GetString(messagePart.Body);
// message body
modify the above program so that, after receiving the email, the system
Upvotes: 3