Ok good evening
here is what i am trying to acomplish, i have a console application now i addeda windows reference to it and it has this 'using System.Windows.Forms;' now i want to do something again like add a TextBox or RichText to the app so i can output messages like this to send email
I am Lost about this. How do i go about it..
here is what i am trying to acomplish, i have a console application now i addeda windows reference to it and it has this 'using System.Windows.Forms;' now i want to do something again like add a TextBox or RichText to the app so i can output messages like this to send email
C#:
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(); //create the message
msg.To.Add("username@gmail.com)
msg.From = new MailAddress("username@gmail.com", "username", System.Text.Encoding.UTF8);
msg.Subject = "TestMail";
msg.SubjectEncoding = System.Text.Encoding.UTF8;
msg.Body = "ciao ale"; // Here it should use the Rich TextBox or TextField.
msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.IsBodyHtml = false;
msg.Priority = MailPriority.High;
SmtpClient client = new SmtpClient(); //Network Credentials for Gmail
client.Credentials = new System.Net.NetworkCredential("username@gmail.comassword");
client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
Attachment data = new Attachment(Program.path);
msg.Attachments.Add(data);
msg.Send();
I am Lost about this. How do i go about it..