J
jamilabkh
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(toTextBox.Text, fromTextBox.Text, subjectTextBox.Text,
bodyTextBox.Text);
SmtpClient obj = new SmtpClient(SMTPTextBox.Text);
obj.Send(mailMessage);
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(toTextBox.Text, fromTextBox.Text, subjectTextBox.Text,
bodyTextBox.Text);
SmtpClient obj = new SmtpClient(SMTPTextBox.Text);
obj.Send(mailMessage);
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,