Easy way to send an email from C# windows application
-
Hello All. I was wondering if anybody new the framework or some example code to send an email from a windows application. This can be done via launching a window which will have an 'automatic' attachment to be sent as an issues report. This could also be done transparenently, i.e. Without launching the outlook window...Probably allot more complicated. Any help would be appreciated. Cheers
-
Hello All. I was wondering if anybody new the framework or some example code to send an email from a windows application. This can be done via launching a window which will have an 'automatic' attachment to be sent as an issues report. This could also be done transparenently, i.e. Without launching the outlook window...Probably allot more complicated. Any help would be appreciated. Cheers
-
Hello All. I was wondering if anybody new the framework or some example code to send an email from a windows application. This can be done via launching a window which will have an 'automatic' attachment to be sent as an issues report. This could also be done transparenently, i.e. Without launching the outlook window...Probably allot more complicated. Any help would be appreciated. Cheers
just look www.codeproject.com/KB/cs/Sending_Mails_From_C_.aspx or First find the System.Web.dll in your computer drive where .NET Framework installed Then add a reference to that dll in your C# windows application. then write following code to send email.... string smtpServer; smtpServer= "127.0.0.1"; System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage(); msg.From = "From Email Address"; msg.To = "To Email Address"; msg.Body = "Body here"; System.Web.Mail.MailAttachment attachFile = new System.Web.Mail.MailAttachment("Filepath"); System.Web.Mail.SmtpMail.SmtpServer = smtpServer; System.Web.Mail.SmtpMail.Send(msg); or First find the System.Web.dll in your computer drive where .NET Framework installed Then add a reference to that dll in your C# windows application. then write following code to send email.... string smtpServer; smtpServer= "127.0.0.1"; System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage(); msg.From = "From Email Address"; msg.To = "To Email Address"; msg.Body = "Body here"; System.Web.Mail.MailAttachment attachFile = new System.Web.Mail.MailAttachment("Filepath"); System.Web.Mail.SmtpMail.SmtpServer = smtpServer; System.Web.Mail.SmtpMail.Send(msg);