emailsender


Joined
Dec 18, 2012
Messages
2
Reaction score
0
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 address removed)";
// string from = "(e-mail address removed)";
//string from = "(e-mail address removed)";
string to = "(e-mail address 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());

}
}
}
}
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top