2011-02-01 109 views
1

我該如何通過密件抄送asp.net(c#)發送大量郵件?通過密件抄送郵件

+0

您可以刪除sql標記,請將其與標記無關。 – Dunc 2011-02-01 10:50:11

回答

3

根據the documentation你做這樣的:

public static void CreateBccTestMessage(string server) 
{ 
MailAddress from = new MailAddress("[email protected]", "Ben Miller"); 
MailAddress to = new MailAddress("[email protected]", "Jane Clayton"); 
MailMessage message = new MailMessage(from, to); 
message.Subject = "Using the SmtpClient class."; 
message.Body = @"Using this feature, you can send an e-mail message from an application very easily."; 
MailAddress bcc = new MailAddress("[email protected]"); 
message.Bcc.Add(bcc); 
SmtpClient client = new SmtpClient(server); 
client.Credentials = CredentialCache.DefaultNetworkCredentials; 
Console.WriteLine("Sending an e-mail message to {0} and {1}.", 
      to.DisplayName, message.Bcc.ToString()); 
    try { 
    client.Send(message); 
    } 
    catch (Exception ex) { 
    Console.WriteLine("Exception caught in CreateBccTestMessage(): {0}", 
       ex.ToString()); 
    } 
} 

你只需要添加一些BCC地址。請注意,發送羣發郵件很容易讓您列入黑名單,並且大部分郵件可能會以垃圾郵件文件夾結尾。相反,您應該考慮使用羣發郵件服務提供商。

相關問題