本文介绍了发送在线电子邮件的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Rahul Attarde,我想输入联系我们表格的代码并抛出联系我们"页面,我用C#发送在线电子邮件.
请帮助我解决这个问题.
Hi,
I am Rahul Attarde,i want code for contact us form and throw contact us page,i send online email in C#.
Please help me about this problem.
推荐答案
MailMessage MailMesaji = new MailMessage();
MailMesaji.Subject = "Hello";
MailMesaji.Body = " How are u";
MailMesaji.BodyEncoding = Encoding.GetEncoding("Windows-1254");
MailMesaji.From = new MailAddress("Email Sender @ Domain");
MailMesaji.To.Add(new MailAddress("Email Reciever @ Domain"));
SmtpClient Smtp = new SmtpClient("smtp.mail.yahoo.com");
OpenFileDialog Ofd = new OpenFileDialog();
if (Ofd.ShowDialog() == DialogResult.OK)
{
string Att = Ofd.FileName;
Attachment ATTa = new Attachment(Att);
MailMesaji.Attachments.Add(ATTa);
}
Smtp.Credentials = new System.Net.NetworkCredential("Email Sender @ Domain", "PWD");
Smtp.Send(MailMesaji);
MessageBox.Show("mail Send");
这篇关于发送在线电子邮件的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!