如何向桌面应用程序的用户发送邮件和短信? [英] How do I send mail and sms to people with desktop application?

查看:127
本文介绍了如何向桌面应用程序的用户发送邮件和短信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发桌面软件并且代码有问题。

有谁知道使用Winform桌面应用程序向用户发送邮件和短信的代码?

请帮助我是否有人?

I am developing desktop software and having problem with the code.
Can anyone know the code for send mail and sms to user using Winform Desktop Application?
Please Help me if anyone have?

推荐答案

试试这个:使用或不使用附件在C#中发送电子邮件:通用例程。 [ ^ ]


Net.Mail;



MailMessage message = new MailMessage();

var smtpClient = new SmtpClient();

message.Subject =test mail;

message.IsBodyHtml = true;

message.Body =这是测试邮件;

message.To.Add(test@gmail.com);

smtpClient.Send(message)
using System.Net.Mail;

MailMessage message = new MailMessage();
var smtpClient = new SmtpClient();
message.Subject = "test mail";
message.IsBodyHtml = true;
message.Body = "This is test mail";
message.To.Add("test@gmail.com");
smtpClient.Send(message)


这篇关于如何向桌面应用程序的用户发送邮件和短信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆