I tried to send email via c# by following:
try {
MailMessage message = new MailMessage();
message.To.Add("receiver@mail.com");
message.Subject = "This is the Subject line";
message.From = new MailAddress("sender@online.microsoft.com");
message.Body = "This is the message body";
SmtpClient smtp = new SmtpClient("http://schemas.microsoft.com/cdo/configuration/smtpserver");
smtp.Send(message);
} catch (Exception ex) {
Response.Write(ex.ToString());
}
I get the error message:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'http://schemas.microsoft.com/cdo/configuration/smtpserver' at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) at......
I've never done this before. Any help would be much appreciated.