C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







sending mail


Posted Date: 07 May 2008    Resource Type: Code Snippets    Category: C# Syntax

Posted By: Abhishek Arya       Member Level: Diamond
Rating:     Points: 5



using System.Net;using System.Net.Mail;using System.Text;namespace aspspiderfreebooks.Net{ public class WebMail { public static void SMTP() { MailMessage mailMsg = new MailMessage(); mailMsg.From = new MailAddress("youremail@example.com"); mailMsg.To.Add("someone@example.com"); mailMsg.Subject = "mail test"; mailMsg.IsBodyHtml = true; mailMsg.BodyEncoding = Encoding.UTF8; mailMsg.Body = "This email is sent dotnetspider code"; mailMsg.Priority = MailPriority.Normal; // Smtp configuration SmtpClient client = new SmtpClient(); client.Credentials = new NetworkCredential("youremail@yshoomail.vom", "yourpassword"); client.Port = 587; //or use 465 client.Host = "mail.yahoo.com"; client.EnableSsl = true; object userState = mailMsg; try { //you can also call client.Send(msg) client.SendAsync(mailMsg, userState); } catch (SmtpException) { //Catch errors... } } }}





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Plateform Invoke to call Win32 function
Previous Resource: Data bind a Control to an Enum
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween masks

Contact Us    Privacy Policy    Terms Of Use