예제 #1
0
 public static void HandlePostMessage(MailMessage message)
 {
     using (SmtpClient smtpClient = SmtpUtil.CreateSmtpClient())
     {
         smtpClient.Send(message);
     }
 }
예제 #2
0
        static void SendSupportEmail(Trade trade, SkuView sku, string sellerName, string sellerPhone)
        {
            string templateBody = GetTemplateBody("~/templates/tradeNotice.txt", "en-US");

            templateBody = templateBody.Replace("{TradeCode}", trade.TradeCode);
            templateBody = templateBody.Replace("{Quantity}", trade.Quantity.ToString());
            templateBody = templateBody.Replace("{SkuName}", sku.FullName);
            templateBody = templateBody.Replace("{Total}", trade.Total.ToString());
            templateBody = templateBody.Replace("{Currency}", trade.Currency);
            templateBody = templateBody.Replace("{BuyerName}", trade.BuyerUserName);
            templateBody = templateBody.Replace("{BuyerPhone}", trade.BuyerPhoneNumber);
            templateBody = templateBody.Replace("{SellerName}", sellerName);
            templateBody = templateBody.Replace("{SellerPhone}", sellerPhone);

            MailMessage message = new MailMessage(WebApplication.Instance.SmtpSettings.Username, WebApplication.Instance.SupportEmail);

            message.Subject    = String.Format("Trade Notice {0}", trade.TradeCode);
            message.Body       = templateBody;
            message.IsBodyHtml = false;
            SmtpClient smtpClient = SmtpUtil.CreateSmtpClient();

            smtpClient.SendAsync(message, null);
        }
예제 #3
0
        static void SendEmail(MailMessage msg)
        {
            SmtpClient smtpClient = SmtpUtil.CreateSmtpClient();

            smtpClient.SendAsync(msg, null);
        }