using System; using System.Net; using System.Net.Mail; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace MailSend { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void label3_Click(object sender, EventArgs e) { } private void groupBox2_Enter(object sender, EventArgs e) { } private void Form1_Load(object sender, EventArgs e) { } private void textBox6_TextChanged(object sender, EventArgs e) { } private void groupBox1_Enter(object sender, EventArgs e) { } private void textBox5_TextChanged(object sender, EventArgs e) { } private void btnBrowse_Click(object sender, EventArgs e) { OpenFileDialog obj = new OpenFileDialog(); DialogResult res = obj.ShowDialog(); if (res == DialogResult.OK) { string fpath; fpath = obj.FileName; txtAttachments.Text = fpath; } } private void button1_Click(object sender, EventArgs e) { SmtpClient obj = new SmtpClient(); NetworkCredential n = new NetworkCredential(txtFrom.Text, "Jeetendra", System.Text.Encoding.UTF8); msg.From = m; msg.To.Add(txtTo.Text); msg.Subject = txtSub.Text; msg.Body = txtBody.Text; msg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; Attachment a = new Attachment(txtAttachments.Text); msg.Attachments.Add(a); obj.Send(msg); MessageBox.Show("Mail Sent Successfully.....!!!!"); } } }
following errors ar coming... Error 1 The best overloaded method match for 'System.Net.NetworkCredential.NetworkCredential(string, string, string)' has some invalid arguments D:\BE630\MailSend\MailSend\Form1.cs 67 35 MailSend Error 2 Argument '3': cannot convert from 'System.Text.Encoding' to 'string' D:\BE630\MailSend\MailSend\Form1.cs 67 84 MailSend Error 3 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 68 13 MailSend Error 4 The name 'm' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 68 24 MailSend Error 5 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 69 13 MailSend Error 6 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 70 13 MailSend Error 7 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 71 13 MailSend Error 8 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 72 13 MailSend Error 9 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 74 13 MailSend Error 10 The name 'msg' does not exist in the current context D:\BE630\MailSend\MailSend\Form1.cs 75 22 MailSend
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)