hi all,
i wrote a program that's supposed to me Like a mailer
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.Net.Mail;
using System.Web;
namespace CS.NET_Mailer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btn_Send_Click(object sender, EventArgs e)
{
MailAddress from = new MailAddress(txtFrom.Text);
MailAddress to = new MailAddress(txtTo.Text);
MailMessage mMsg = new MailMessage();
mMsg.From = from;
mMsg.To.Add(to);
mMsg.Subject = txtSubject.Text;
mMsg.Body = txtBody.Text;
SmtpClient smtp = new SmtpClient("127.0.0.1");
try
{
smtp.Send(mMsg);
}
catch (SmtpException)
{
MessageBox.Show("Failed ! ");
}
}
}
}
it always "Failed ! " .
The Project is here :
http://www.rogepost.com/n/2420010321
so any ideas ?