.net郵件發送問題(急)?
以下是我的代碼,對外發送是可以成功的,但我想實現的是我們公司的內部郵件發送(實現域內郵件發送)請問應該怎麼實現?或者有沒有更好的方法可以實現 域內郵件條件發送??protected void Page_Load(object sender, EventArgs e)
{
//System.Configuration.ConfigurationSettings.AppSettings["MailPassWord"].ToString());
if (!Page.IsPostBack)
{
CreateCopyMessage("localhost");
}
}
public static void CreateCopyMessage(string server)//string server
{
MailAddress from = new MailAddress("postmaster@mamalove.com.cn", "");
MailAddress to = new MailAddress("ITD Endyping ", "");
MailMessage message = new MailMessage(from, to);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.Subject = "MY GOD!我的檢核表";
message.Body = @"這是發送郵件的測試,不知內部郵件發送是否能成功!";
message.IsBodyHtml = true; //设置邮件为HTML形式
message.Priority = MailPriority.High; //设置邮件优先级为高
MailAddress copy = new MailAddress("taozhongping840115@sina.com");
message.CC.Add(copy);
SmtpClient client = new SmtpClient(server); //成生SMTP传输类,发送邮件
client.UseDefaultCredentials = false;
//client.ServicePoint = "172.16.10.248";
//SmtpClient client = new SmtpClient();
client.Credentials = CredentialCache.DefaultNetworkCredentials;
client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;//指定傳送形式
//Console.WriteLine("Sending an e-mail message to {0} by using the SMTP host {1}.",
// to.Address, client.Host);
client.Send(message);
}
------解决方案--------------------你用即时通信多好啊!!
有开源的协议xmpp!!
还有开源的代码!!
开源的服务端和客户端!!
------解决方案--------------------內部 外部 沒什麼區別吧
------解决方案--------------------
来是解决问题的
------解决方案--------------------用Jmail试试. .NET发邮件, 问题很多很怪