Issue in sending mail
The pickup directory path is required and was not specified while attempting to send a mail
MailMessage message = new MailMessage();
//Set the UserId
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "XXX");
//Password
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "");
//SMTP PortNo
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25");
//Authentication Type
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1);
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",1) ;
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
SmtpMail.SmtpServer = "XXX";
//Set all other required Parameter of email.
message.To = "XXX";
message.From = "XXX";
message.Subject = "Test Mail";
message.Body = "This is a test mail";
SmtpMail.Send(message);
Thanks in advance
|