2014-04-08 5 views

답변

0

다음 코드를 기반으로 할 수 있습니다. Normaly 사람들이 SMTP 서버가 허용하지 구성 - 그것이 내가 다음 "[email protected]"로 인증하여 "[email protected]을"말에서 메시지를 보내려고 제대로 이해하면

MailMessage mailMessage = new MailMessage(); 
mailMessage.IsBodyHtml = true; 
mailMessage.From = new MailAddress("[email protected]", "Subject"); // You can try changing this to the email address you want 
mailMessage.ReplyToList.Add("[email protected]"); // Here you can add reply to 
mailMessage.Subject = "ENQUIRY - " + DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss"); 
mailMessage.Body = ""; // The body of email 
SmtpClient smtpClient = new SmtpClient("mail.company-domain.com"); 
smtpClient.Credentials = new NetworkCredential("username", "password"); 
smtpClient.Port = 587; // We used this port instead of port 25 
smtpClient.Send(mailMessage); 
관련 문제