有ASP。NET 收发邮件的代码吗??????????????有的话贴下。。。最好发我。。。。
QQ 114566570
望好心人。。伸出援手
问题点数:20、回复次数:4Top
1 楼time_is_life(今夜太冷:http://timeislife.blog.sohu.com)回复于 2006-03-20 13:32:36 得分 10
using System;
using System.Web.Mail;
namespace SendMail
{
class usage
{
public void DisplayUsage()
{
Console.WriteLine("Usage SendMail.exe <to> <from> <subject> <body>");
Console.WriteLine("<to> the addresses of the email recipients");
Console.WriteLine("<from> your email address");
Console.WriteLine("<subject> subject of your email");
Console.WriteLine("<body> the text of the email");
Console.WriteLine("Example:");
Console.WriteLine("SendMail.exe SomeOne@Contoso.com;SomeOther@Contoso.com Me@contoso.com Hi hello");
}
}
class Start
{
// The main entry point for the application.
[STAThread]
static void Main(string[] args)
{
try
{
try
{
MailMessage Message = new MailMessage();
Message.To = args[0];
Message.From = args[1];
Message.Subject = args[2];
Message.Body = args[3];
try
{
SmtpMail.SmtpServer = "your mail server name goes here";
SmtpMail.Send(Message);
}
catch(System.Web.HttpException ehttp)
{
Console.WriteLine("{0}", ehttp.Message);
Console.WriteLine("Here is the full error message output");
Console.Write("{0}", ehttp.ToString());
}
}
catch(IndexOutOfRangeException)
{
usage use = new usage();
use.DisplayUsage();
}
}
catch(System.Exception e)
{
Console.WriteLine("Unknown Exception occurred {0}", e.Message);
Console.WriteLine("Here is the Full Message output");
Console.WriteLine("{0}", e.ToString());
}
}
}
}
Top
2 楼robert2004(我能发财)回复于 2006-03-20 14:14:47 得分 0
网上一搜大把
---------------------------
苦海无边 回头无岸
---------------------------
Top
3 楼chinank(中国南开)回复于 2006-03-20 14:27:34 得分 0
你要什么语言的,我有vb
.net的。Top
4 楼chinank(中国南开)回复于 2006-03-20 14:27:52 得分 10
错了,是vb语法的Top




