private void btnSend_Click_1(object sender, EventArgs e)
{
To = txtPhoneNumber.Text.Trim() + cboCarrier.SelectedItem.ToString().Trim();
From = txtSender.Text.Trim();
Subject = txtSubject.Text.Trim();
MailServer = txtMailServer.Text.Trim();
Msg = txtMessage.Text.Trim();
try
{
MailMessage message = new MailMessage(From, To, Subject, Msg);
SmtpClient mySmtpClient = new SmtpClient(MailServer);
mySmtpClient.UseDefaultCredentials = true;
mySmtpClient.Send(message);
MessageBox.Show("Message has been sent to " + message.To.ToString(), "Mail", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
It seems this is the event that is causing the issue , but I dont know why here is the exception I get from Windows when I click "send" :