2

I am working on a Windows 10 store app project. In my project I need to send confirmation email to client using my app. How can I do it without using any confirmation dialogue to show to user?

Confirmation email is like

"You order no "xy" has been confirmed."
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
paradox
  • 602
  • 6
  • 13
  • It's not clear what you want. Do you want to connect to some kind of smtp server and send mail? – Zuzlx Dec 14 '15 at 17:46
  • FWIW, I googled your question title and the first result was an MSDN article updated for UWP apps. – chris Dec 14 '15 at 17:46
  • 2
    Possible duplicate of [Send e-mail via SMTP using C#](http://stackoverflow.com/questions/9201239/send-e-mail-via-smtp-using-c-sharp) – Johnie Karr Dec 14 '15 at 18:10
  • To share content on WinRT, you have to use DataTransferManager. If you want prepare a mail and let user send it, you can use a snippet like : await Launcher.LaunchUriAsync(new Uri("mailto:test@mail.com?subject=my email subject&body=my email body")); – t.ouvre Dec 15 '15 at 09:36

1 Answers1

3
using System.Net.Mail;

...

MailMessage mail = new MailMessage("you@yourcompany.com", "user@hotmail.com");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.google.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);

reference: Send email with C#

Also as mentioned in the comments see this : MSDN Docs Send Email

Community
  • 1
  • 1
barthr
  • 430
  • 7
  • 15