MVC C# Mail Gönderim İşlemleri ( SMTP)
<blockquote> <p>Sayfa </p> <p>SmtpClient client = new SmtpClient();<br /> MailAddress from = new MailAddress("destek@dgn-yazilim.com");//nereden<br /> MailAddress to = new MailAddress("eray@dgn-yazilim.com");//nereye</p> <p> MailMessage msg = new MailMessage(from, to);<br /> msg.To.Add(mail);<br /> msg.IsBodyHtml = true;<br /> msg.Subject = "Konu"<br /> msg.Body += selam; //burada başında gönderen kişinin mail adresi geliyor</p> <p> NetworkCredential info = new NetworkCredential("destek@dgn-yazilim.com", "mail şifresi");<br /> client.Port = 587;<br /> client.Host = "mail.dgn-yazilim.com";<br /> client.EnableSsl = false;<br /> client.Credentials = info;<br /> client.Send(msg);</p> </blockquote>
0 Yorum