如何收发邮件? [英] how to Send and receive Mail ?

查看:115
本文介绍了如何收发邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我是banjar :-D如何从一个人发送和接收邮件写了一封信并将其发送给其他人,并且此消息包含语音和图像的附件到另一个

Hello
I am banjar :-D how to send and receive Mail from one person wrote a letter and send it to someone else and this message contains attachments of voice and image to another

推荐答案

玩得开心:)
http://www.c-sharpcorner.com/UploadFile/scottlysle/EmailAttachmentsCS08052008234321PM/Easpx [ ^ ]
Have fun :)
http://www.c-sharpcorner.com/UploadFile/scottlysle/EmailAttachmentsCS08052008234321PM/EmailAttachmentsCS.aspx[^]


尝试这一操作可能会帮助您发送电子邮件

受保护的void sendEmail(字符串地址,字符串主题,字符串来自,字符串主体)
{
System.Net.Mail.MailMessage消息=新的System.Net.Mail.MailMessage();
message.To.Add(地址);
message.Subject =主题;
message.From =新的System.Net.Mail.MailAddress(来自);
message.Body = body;
System.Net.Mail.SmtpClient smtp =新的System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Credentials =新的System.Net.NetworkCredential(主机",密码");
smtp.Port = 587;
smtp.Send(message);

}
try this one it may help you to send email

protected void sendEmail(string address, string subject, string from, string body)
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(address);
message.Subject = subject;
message.From = new System.Net.Mail.MailAddress(from);
message.Body = body;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Credentials = new System.Net.NetworkCredential("host", "password");
smtp.Port = 587;
smtp.Send(message);

}


这篇关于如何收发邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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