本文介绍了通过Windows 2008 SMTP服务发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个托管在Windows服务中的WCF服务,该服务需要使用Windows 2008默认SMPTP服务发送电子邮件

此外,WCF服务也托管在Windows 2008服务器中。


 

有没有人真正这样做过?有人可以帮我们吗?
如果有任何资源请告诉我。

这是我编写的代码,似乎不起作用  

SmtpClient client = new SmtpClient " localhost" ,25);  
MailMessage mailMessage = new MailMessage " [email protected]" " [email protected]"   " Testing" "请注意" ); 
client.Host =
" 127.0.0.1"
client.Send(mailMessage);

 

Is there anyone who has actually done this? Can someone help us on this?
If there any resource on this please let me know.

This is the code that I have written and does not seem to work 

SmtpClient client = new SmtpClient("localhost", 25); 
MailMessage mailMessage = new MailMessage("[email protected]", "[email protected]", "Testing", "Attention Please"); 
client.Host =
"127.0.0.1"
client.Send(mailMessage);

}

 

推荐答案


这篇关于通过Windows 2008 SMTP服务发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 01:54