Can i send email without giving password on the NetworkCredentials
? here is my code.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
MailMessage Myemail = new MailMessage();
private void btnsendemail_Click(object sender, EventArgs e)
{
SmtpClient myGmailserver = new SmtpClient("smtp.gmail.com",587);
myGmailserver.Credentials = new NetworkCredential("Email ID", "password");
Myemail.From = new MailAddress("Email ID");
Myemail.To.Add(tbTo.Text);
Myemail.Subject = tbsubject.Text;
Myemail.Body = tbmsg.Text;
myGmailserver.EnableSsl = true;
myGmailserver.Send(Myemail);
}
}
on the line myGmailserver.Credentials = new NetworkCredential("Email ID", "Password");
it asks for a password for that specific email what if i want to send email to someone and not knowing the password of that email how can i do it? please answer