C#.NET MAIL Gonderme

DrogbA

Forum Üyesi
Katılım
27 Ara 2020
Mesajlar
3,440
Tepkime puanı
0
Puanları
36
PHP:
  #region SMTP Mail Gönder            public bool sendEmail(                 string pEmail,                 string pPassword,                 string pTo,                 string pSubject,                 string pBody,                 System.Web.Mail.MailFormat pFormat,                 string pAttachmentPath)            {                 try                 {                      System.Web.Mail.MailMessage myMail = new System.Web.Mail.MailMessage();                      myMail.Fields.Add                           ("http://schemas.microsoft.com/cdo/configuration/smtpserver",                           "smtp.webadresi.gov.tr");                      myMail.Fields.Add                           ("http://schemas.microsoft.com/cdo/configuration/smtpserverport",                           "25");                      myMail.Fields.Add                           ("http://schemas.microsoft.com/cdo/configuration/sendusing",                           "2");                                            myMail.Fields.Add                           ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1");                                            myMail.Fields.Add                           ("http://schemas.microsoft.com/cdo/configuration/sendusername",                           pEmail);                      myMail.Fields.Add                           ("http://schemas.microsoft.com/cdo/configuration/sendpassword",                           pPassword);                      /*myMail.Fields.Add                                ("http://schemas.microsoft.com/cdo/configuration/smtpusessl",                                "true");*/                      myMail.From = pEmail;                      myMail.To = pTo;                      myMail.Subject = pSubject;                      myMail.BodyFormat = pFormat;                      myMail.Body = pBody;                      if (pAttachmentPath.Trim() != "")                      {                           MailAttachment MyAttachment =                                new MailAttachment(pAttachmentPath);                           myMail.Attachments.Add(MyAttachment);                           myMail.Priority = System.Web.Mail.MailPriority.High;                      }                       System.Web.Mail.SmtpMail.SmtpServer = "smtp.webadresi.gov.tr:25";                      System.Web.Mail.SmtpMail.Send(myMail);                      return true;                 }                 catch (Exception ex)                 {                      throw;                 }            }             #endregion
 

Peri

Co Admin
Katılım
2 May 2020
Mesajlar
4,949
Tepkime puanı
0
Puanları
36
Takım
Beşiktaş
Teşekkürler
 

Nutella

Bayan Üye
Özel Üye
Katılım
2 Ocak 2021
Mesajlar
3,559
Tepkime puanı
0
Puanları
36
Cinsiyet
  1. Bayan
Takım
Galatasaray
Paylaşım için teşekkürler.
 
metal işleme
Üst