Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > emailsender

Reply
Thread Tools

emailsender

 
 
SoniaArun SoniaArun is offline
Junior Member
Join Date: Dec 2012
Posts: 2
 
      12-18-2012
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;

namespace emailsender
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
try
{

string from = "(E-Mail Removed)";
// string from = "(E-Mail Removed)";
//string from = "(E-Mail Removed)";
string to = "(E-Mail Removed)";


MailAddress mailfrom = new MailAddress(from);
MailAddress mailto = new MailAddress(to);

MailMessage msg = new MailMessage();
msg.Subject = "test mail";
msg.Body = "hai from software";
msg.From = mailfrom;
msg.To.Add(mailto);
msg.Priority = MailPriority.High;

SmtpClient mail = new SmtpClient("smtp.mail.turnerandmiller.us", 25);
// SmtpClient mail = new SmtpClient("smtp.mail.gmail.com", 25);
// SmtpClient mail = new SmtpClient("smtp.gmail.com", 587);
// SmtpClient mail = new SmtpClient("smtp.mail.yahoo.com", 25);
//mail.EnableSsl = true;
mail.Credentials = new System.Net.NetworkCredential(from, "gorgeous");
mail.Send(msg);

MessageBox.Show("hai");
}
catch (Exception ex)
{
Console.WriteLine("InnerException is: {0}", ex.InnerException);
MessageBox.Show(ex.ToString());

}
}
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unique emailsender makes W98SE crash Maria Computer Support 5 01-18-2004 07:06 PM



Advertisments