Hi all,
I need to know how to authenticate a user before sending a mail using a
C# application.
The source code i use is this:
private void sendMailButton_ Click(object sender, EventArgs e)
{
try
{
MailMessage mailMessage = new
MailMessage(toT extBox.Text, fromTextBox.Tex t, subjectTextBox. Text,
bodyTextBox.Tex t);
SmtpClient obj = new SmtpClient(SMTP TextBox.Text);
obj.Send(mailMe ssage);
MessageBox.Show ("Message Sent");
}
catch (Exception ex)
{
MessageBox.Show ("message not sent");
}
}
I need to add the authentication part. This is working but with no
authentication for the user or the mail sender address. I am using a
local SMTP server.
Thanks,
I need to know how to authenticate a user before sending a mail using a
C# application.
The source code i use is this:
private void sendMailButton_ Click(object sender, EventArgs e)
{
try
{
MailMessage mailMessage = new
MailMessage(toT extBox.Text, fromTextBox.Tex t, subjectTextBox. Text,
bodyTextBox.Tex t);
SmtpClient obj = new SmtpClient(SMTP TextBox.Text);
obj.Send(mailMe ssage);
MessageBox.Show ("Message Sent");
}
catch (Exception ex)
{
MessageBox.Show ("message not sent");
}
}
I need to add the authentication part. This is working but with no
authentication for the user or the mail sender address. I am using a
local SMTP server.
Thanks,