S
sravan_reddy001
i'm trying to write a win app to send a mail...
but the error message saying "Mail" doesn't exist in Web Name space..
( .net framework 2.0 used)
Error 1 The type or namespace name 'Mail' does not exist in the
namespace 'System.Web' (are you missing an assembly reference?) F:
\VS.net\Holidays\MailApplication\MailApplication\Form1.cs 8 18
MailApplication
this is the code....
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Web.Mail;
namespace MailApplication
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To = textBox1.Text;
mail.From = textBox2.Text;
mail.Subject = textBox3.Text;
mail.Body = textBox4.Text;
mail.SendMail();
SmtpMail.SmptServer = "localhost";
SmtpMail.SendMail(mail);
}
}
}
but the error message saying "Mail" doesn't exist in Web Name space..
( .net framework 2.0 used)
Error 1 The type or namespace name 'Mail' does not exist in the
namespace 'System.Web' (are you missing an assembly reference?) F:
\VS.net\Holidays\MailApplication\MailApplication\Form1.cs 8 18
MailApplication
this is the code....
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Web.Mail;
namespace MailApplication
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To = textBox1.Text;
mail.From = textBox2.Text;
mail.Subject = textBox3.Text;
mail.Body = textBox4.Text;
mail.SendMail();
SmtpMail.SmptServer = "localhost";
SmtpMail.SendMail(mail);
}
}
}