- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Net.Mail;
- using System.Net;
- namespace smtp_client
- {
- class Program
- {
- static void Main (string[] args)
- {
- MailAddress myemail = new MailAddress("me@gmail.com", "Name");
- MailAddress mail_to = new MailAddress("receiver@yahoo.com", "Receiver");
- string password = "email_password";
- SmtpClient Client_smtp = new SmtpClient("smtp.gmail.com", 587);
- client_smtp.EnableSsl = true;
- client_smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
- client_smtp.UseDefaultCredentials = false;
- client_smtp.Credentials = new NetworkCredential (myemail.Address, password);
- MailMessage message = new MailMessage (myemail, mail_to);
- message.Subject = "Hello from sharpcode";
- message.Body = "just a test";
- client_smtp.Send(message);
- }
- }
- }
gmail
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Gmail邮箱注册
前言~~(胡言乱语)~~ 在屏幕前的你有没有谷歌邮箱呢 让我猜猜 应该是有的吧,
折腾 chrome 下载地址 搜索 -
gmail 安装outlook
附件
安装 outlook gmail