By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,150 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,150 IT Pros & Developers. It's quick & easy.

Email... HELP

P: n/a
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("fe****@gmail.com");
mail.To.Add("fe****@gmail.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("smtp.gmail.com");

smtp.EnableSsl = false;

//to authenticate we set the username and password
properites on the SmtpClient
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new
NetworkCredential("gmailLogin","gmailPassword","lo calhost");
smtp.Send(mail);
itīs ok??
why it does not send the email??

Mar 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Put a breakpoint on the line you create a new instance of SmtpClient and
check what is missing...
"blini" <fe**********@gmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("fe****@gmail.com");
mail.To.Add("fe****@gmail.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("smtp.gmail.com");

smtp.EnableSsl = false;

//to authenticate we set the username and password
properites on the SmtpClient
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new
NetworkCredential("gmailLogin","gmailPassword","lo calhost");
smtp.Send(mail);
itīs ok??
why it does not send the email??
Mar 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.